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.
On 11 Jun 2008, at 03:23, Phlip wrote:
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 ‘
’
end
and then in your view
<%= locals {} %>
(removing ActionView::Base.erb_variable is just a convenience, it
rather clogs up the output otherwise)
Fred
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs