Giter VIP home page Giter VIP logo

assetable's People

Contributors

rlmattax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

assetable's Issues

strong params

Do you guys have any suggestions on how to make the strong params suck less?

On the activity model:
galleryable :briefing_gallery, :debriefing_gallery

In the activities controller:
params.require(:activity).permit([:name, :description, :start_at, :end_at,
:briefing_gallery_attributes=>{:asset_attachments_attributes=>[:id,:asset_id,:sort_order]},
:debriefing_gallery_attributes=>{:asset_attachments_attributes=>[:id,:asset_id,:sort_order]}])

Runtime allowed extensions

Defaults are good but should be overrideable in the assetable model helper.

Assetable :field, {:allowed => %w(html pdf)}

Use on non-image assets

I'm hoping to find a way to attach non-image objects to a model. The example at hand is an html file.

I'm also trying to do the attachment within a model instead of using the uploader.

Do you have any suggestions for doing these things?

This is how I'm using it

--------------

publisher.rb

assetable :ad_block # the html chunk

Then just for the sake of testing things, I opened the console, and attempted (based largely on my experience with carrier wave):

publisher.ad_block = File.open("ad_block.html")

ang get this error:
NoMethodError: undefined method `id' for #File:ad_block.html

Any suggestions?

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.