rails wish list

Looks like my wish list for rails currently is

<%= radio_button_tag :school_type, type, '' %>

This in my opinion should default to 'not selected' :slight_smile: -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