Displaying 2 results from an estimated 2 matches for "body_class".
2008 Jan 24
3
Help to spec a rails helper method that uses content_for
...am a Rspec newbie and am having problems creating a spec for a RoR helper
method.
I have in fact already implemented the helper method and am trying to create
retrospective specs. I know its the wrong way to do it but I am still
learning Rspec.
In my view I have a call to a helper method.
<% body_class "users" %>
which sets a CSS class declaration in the content_for block which is then
used in the <body> tag in application.html.erb layout.
def body_class(class_name)
content_for(:body_class) { " class=\"#{class_name}\"" }
end
I was trying the foll...
2005 Aug 25
1
newbie questions about hosting address
...irectly from the view object: { var:
@text }
4. Example - brackets inside brackets. In this example
we pass only ''actual_page'' variable from the driver script. Body class
will be set depending on it automatically.
----------- YAML -------------
# define classes of body tags
body_class-homepage: normal
body_class-news: normal
body_class-services: threecols
body:
This is body.
----------- RUBY -------------
show( ''body'', { ''actual_page'' => @actual_page } )
5. Example - pieces of code recursive calls.
In daily use: This is really powe...