hi, with Rails 2.0, we have view templates with the new .html.erb extensions, but can also have .css.erb files. does this mean i can put my css files inside my view templates like screen.css.erb or have i got the wrong end of the stick, appreciate anyones answer on this, -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
stylesheet files should live in public/stylesheets and should be linked to by using <%= stylesheet_link_tag "name" %> in the layout of your site, inside a <head> tag. On Wed, Apr 30, 2008 at 12:12 AM, John Griffiths < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > hi, with Rails 2.0, we have view templates with the new .html.erb > extensions, but can also have .css.erb files. > > does this mean i can put my css files inside my view templates like > screen.css.erb or have i got the wrong end of the stick, > > appreciate anyones answer on this, > -- > Posted via http://www.ruby-forum.com/. > > > >-- Ryan Bigg http://www.frozenplague.net Feel free to add me to MSN and/or GTalk as this email. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
i haven''t used it yet, but i think that it''s more about using erb code within your css file, which would allow to give them some nice things like user selectable color sets .menu { color: <%= @user.settings.text_color; %> background: <%= @user.settings.bg_color; %>; } hmm, i can think about a lot of stuff to do with it if it works that way. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
yep, Thorsten, would be pretty cool to have dynamic css files, don''t think it works this way just confused by the extension. maybe it''s similar to haml? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Maybe you could store the user''s color selections in a sort of "user preferences" model (which is what I''ve done with other user info). I track the user''s preferred "page length" (rows per page in an index view), "sort order" per model (saves their current sort columns and order when they logout so its the same when they come back). I was just thinking about colors the other day - one co-worker doesn''t see certain blue hues - "What highlight?" he asks... Perhaps a "standard" stylesheet with my colors, then a stylesheet M-V-C that can maintain a css file per user, and some simple file selection logic in the main layout. Hmm... Oh, and kuler.adobe.com is a great source for manufacturing/finding color schemes... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You can dynamically link a css file (contra Radar ^^^) by using yield and content_for In the layout: <head> ... <%= yield :head %> </head> In the *.html.erb <% content_for :head do %> <% stylesheet_link_tag :page_specific_styles <% end %> Of course, if you _needed_ page specific, dynamic css you could put a style tag inside your content_for :head. On Apr 29, 12:27 pm, Ar Chron <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Maybe you could store the user''s color selections in a sort of "user > preferences" model (which is what I''ve done with other user info). > > I track the user''s preferred "page length" (rows per page in an index > view), "sort order" per model (saves their current sort columns and > order when they logout so its the same when they come back). > > I was just thinking about colors the other day - one co-worker doesn''t > see certain blue hues - "What highlight?" he asks... > > Perhaps a "standard" stylesheet with my colors, then a stylesheet M-V-C > that can maintain a css file per user, and some simple file selection > logic in the main layout. Hmm... > > Oh, and kuler.adobe.com is a great source for manufacturing/finding > color schemes... > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
John Griffiths wrote:> yep, Thorsten, would be pretty cool to have dynamic css files, don''t > think it works this way just confused by the extension. > > maybe it''s similar to haml?You just have to think about how we normally find stylesheets, namely we link to a file located at "/stylesheets/blah.css" normally this looks for a static file in "/public/stylesheets/blah.css" but try adding a controller called Stylesheets. now rails routing will look for a method called "blah" on the StylesheetsController. try it, tweak it, cache it... boom proper dynamic css. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
thanks, i''ll have a bash and see how it goes. appreciate this, John. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---