Git Product home page Git Product logo

simditor-rails's Introduction

simditor-rails

Simditor官方:

http://simditor.tower.im/

simditor-rails

Scott1743/simditor-rails基于Simditor(v1.0.5)和carrierwave,Rails(> 3.2.18) 通用版是一个含有客户端图片上传功能、自动初始化、预设宽度的版本。

配置

在Rails中这样使用simditor-rails:

添加到Gemfile

gem 'simditor', github: 'Scott1743/simditor', branch: 'universal_version'
bundle install

拷贝迁移文件

rake railties:install:migrations
rake db:migrate

在application.rb中引入carrierwave

require 'carrierwave'

初始化示例

可以在页面中直接引用,推荐使用Assets Pipeline方式:

Js:
//= require simditor
//= require simditor/init

Styles:
*= require 'simditor'

页面中使用:

<%= f.text_area :content, simditor: true %>

or

<textarea simditor='true'></textarea>

Simditor已经可以在页面中使用了

初始化说明

初始化的simditor宽度为720px,可以这样初始化来控制初始宽度,例如设宽为800px

<%= f.text_area :content, simditor: 800 %>

也可以不通过引用simditor/init的方式来初始化Simditor 请使用官方的初始化方式:http://simditor.tower.im/tours/tour-usage.html

simditor-rails's People

Contributors

scott1743 avatar

Watchers

James Cloos avatar SuperDepp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.