Forums | Admin

Discussion Forums: open-discussion

Start New Thread Start New Thread

 

By: Bragi Ragnarson
RE: Accessing rcss files in public/stylesheet [ reply ]  
2006-01-30 07:57
In my current setup I have mapped Rcss controller to the path /stylesheets in my routes.rb file:

map.connect('stylesheets/:rcss', :controller => 'rcss', :action => 'render_rcss')

Now you can freely use stylesheet_link_tag. Note however that rcss files should still reside in app/views/rcss

By: Dennis Bell
RE: Accessing rcss files in public/stylesheet [ reply ]  
2006-01-29 22:59
Bragi,
I agree with you about not using the public, but am new to rails and don't know how to solve the problem more elegantly. Basically, in my app/view/layout/ dir, I have the layout file that includes the stylesheets using the stylesheet_include_tag helper. It handles all the path stuff for me. I'd like to use the rcss-based stylesheets, but don't know how to integrate it into my view rhtml-based files. If you could post an example of this usage, I'd be grateful.

Thanks,
Dennis

By: Bragi Ragnarson
RE: Accessing rcss files in public/stylesheet [ reply ]  
2006-01-29 19:29
You may modify your controller to render file instead of template (see: http://api.rubyonrails.com/classes/ActionController/Components.html#M000040).

Personaly I do not recommend such setup as files in public directory are available to view for everyone.

By: Dennis Bell
Accessing rcss files in public/stylesheets [ reply ]  
2006-01-28 21:30
Great functionality - should be integrated right into rails.

I was hoping that I could use its functionality while still putting my .rcss files in public/stylesheets instead of apps/views/rcss/. Is this possible, and if so, how?