On Apr 13, 2013, at 7:24 AM, deepak wrote:

> Originally posted here: 
> http://stackoverflow.com/questions/15986969/where-to-put-plugin-images-in-rails-application
> 
> We use handful of plugins in our Rails application(Rails 3.2.1). As we 
> already know that we should keep all app images app/assets/images folder and 
> css in app/assets/stylesheets. This is what we follow.
> 
> However some plugins use images and keep them in parallel to CSS file.(images 
> and CSS in same folder/level)
> 
> So my question is: (We use Asset Pipeline)
> 
>       • Is it a good practice to keep images of plugin in parallel to CSS 
> file? (I am hoping it's good thing)
>       • If not, then developer has to change the image paths in entire css 
> file (if putting plugin images inapp/assets/images), Which I think is not 
> helpful for future in case you plan to upgrade those plugins.
> Thanks.
> 
> 

You might want to put these in the app/vendor/plugin_name/assets folder tree, 
so you can keep them separate from your application's own code. If these 
stylesheets are written with "awareness" of a folder hierarchy, like maybe with 
../images/icon.png style references to images, then you may have trouble with 
the asset pipeline. I just ran into that in a project here, and had to give up 
and let the "magic" work by removing all prefixes. Once I did that, and just 
referenced url(icon.png) in my CSS, everything just worked. (icon.png was in 
the app/assets/images folder, the stylesheet referencing it was in the 
app/assets/stylesheets folder.)

Walter

> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/rubyonrails-talk/-/OMfFgRvVr1EJ.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to