GithubHelp home page GithubHelp logo

jaggerwoo / genggeng_attachments Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 105 KB

基于carrierwave/simple_form的上传附件功能及样式

License: MIT License

Ruby 50.99% JavaScript 4.09% CoffeeScript 26.56% CSS 17.70% Shell 0.65%
rails carrierwave jquery-fileupload-rails

genggeng_attachments's Introduction

GenggengAttachments

Rails多附件上传功能, 依赖:

  • 'simple_form', "~> 3.2.1"
  • 'carrierwave', "~> 0.10"
  • 'mini_magick'
  • 'jquery-fileupload-rails'
  • 'turbolinks'

Installation

  1. 修改 Gemfile 增加:
# Gemfile
# gem 'genggeng_attachments'
gem 'genggeng_attachments', :git => '[email protected]:WadeJG/genggeng_attachments.git', :branch => 'master'
    
$ bundle
  1. 生成基本配置文件:
$ rails g genggeng_attachments:install

then, add js file included 
    
//= require genggeng_attachments/application

add css file included 

*= require genggeng_attachments/application
  1. 自定义配置
modify config/initializes/genggeng_attachments.rb

GenggengAttachments.configure do
  self.upload_limit_nubmer = 3
end
  1. 在对应model中增加关联关系
has_many :genggeng_attachments, as: :genggeng_attachmentable
  1. 样式

License

The gem is available as open source under the terms of the MIT License.

genggeng_attachments's People

Stargazers

 avatar

Watchers

 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.