views:

24

answers:

2

Hi, could I have a stylesheets directory in Rails' plugin directory?

I am trying to write plugin for a existing Rails webApp, but still not sure how to customize the default CSS for my plugin?

A: 

The typical way is to write a generator in your plugin that copies your custom stylesheet into a special public/stylesheets/you directory in the main app. Then the generator prints out instructions to include the plugin stylesheet in the layouts.

Justice
Not sure did I read it right, but if I only intend to use my stylesheets inside the plugin scope, I don't need the last step "instructions to include the stylesheet in the layout"?
pstar
So, looks like I have to modify the application template for adding "stylesheet_link_tag", that's what the prints out instructions for?
pstar
A: 

Hi,

I have a example for this .

Please Reffer in rails ck editor.

IN rails-ck-editor they will give the css and javascripts in plugin itslef .

By running task we ca get the css files.

Please find the task file in the following path (vendor/plugins/rails-ckeditor/tasks/ckeditor_tasks.rake)

You can use this task according to you.

the rails-ck-editor link is

http://github.com/standout/rails-ckeditor

I suggest this only for your reference.

Thanks & Regards, Ramanaa Selvaa

Ramanavel
Thank you Ramanavel, that is really useful!
pstar