Looks like my wish list for rails currently is
<%= radio_button_tag :school_type, type, '' %>
This in my opinion should default to 'not selected' -R
Looks like my wish list for rails currently is
<%= radio_button_tag :school_type, type, '' %>
This in my opinion should default to 'not selected' -R
Perhaps this is what you're looking for:
<%= radio_button_tag :school_type, type, false %>
The 3rd value is for 'checked' - which should be false or nil to be not checked.
Steve
my latest wish: That rails' error reports told you what the local variables were [say, those that had been passed to a partial]
-R
That rails' error reports told you what the local variables were [say, those that had been passed to a partial]
Rails can't reflect true local variables, as a fundamental limitation of the language. However, if you pass :locals => { :@variable => value } as an instance variable, you might monkey-patch the Rails error formatter to reflect those.
Well I'm not saying it's a good idea, but you can do this:
def locals(&block) Â Â Â names = eval("local_variables", block.binding) - [ActionView::Base.erb_variable] Â Â Â names.map do |name| Â Â Â Â Â value = eval(name, block.binding) Â Â Â Â Â "#{name}: #{h value.inspect}" Â Â Â end.join '<br/>' end
and then in your view <%= locals {} %> (removing ActionView::Base.erb_variable is just a convenience, it rather clogs up the output otherwise)
Fred