views:

29

answers:

1

Most of my views will required a wrapper of padding 10px,,, but a few will not...

I was thinking of doing something like this in the view controller:

 respond_to do |format|
   format.html { render :layout => true, :padding => 'false' }

And then in the application.html.erb have an IF to not add a padding class if :padding is false... But the above idea doesn't work, the variable padding is not being passed.

Any ideas? Or cleaner/smart solutions? thxs

+1  A: 

You need to put them inside the :locals hash:

render :layout => true, :locals => { :padding => false }
Adam Lassek
very cool. Problem is for all the controllers that don't pass padding to application.html.erb, the site now errors with: undefined local variable or method `padding' for #<#<Class:0x102f29fd8>:0x102f27c38>
AnApprentice
Adam Lassek