From the Agile book, page 144 regarding a div tag helper

Hi. in the Rails Agile book here’s what was happening:

module StoreHelper
def hidden_div_if(condition, attributes = {})
if condition
attributes[“style” ] = “display: none”
attrs = tag_options(attributes.stringify_keys)
“<div #{attrs}>”

format_price method …


Note that we cheated slightly here. We copied code from the Rails
helper called content_tag( ); thatâ??s how we knew to call tag_options( )
the way
we did.And how did we find the source code of the content_tag( ) method?
We brought up the
RDoc documentation in a browser and clicked the View Source link.

This just flew gracefully over my head…(duuugh)…

I was at the RDDoc site, and nothing pertaining to helper methods, or a
source containing ‘content_tag()’ was found…

So my question is which source file did Dave talk about? and how often
would we have to do this kind of trick…


It’s a listed method on the main page.

        - dan

Dan K. mailto:[email protected] tel:+1-415-233-1000

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs