You would show and hide the element with JavaScript, but create it in Rails. Simple example:
<div id="favorite-color" style="display:none">
<%= form_for @knight do |f| %>
<%= f.label :favorite_color, 'What\'s your favorite color?' %>
<%= f.collection_select :favorite_color, %w(red green blue aaaaah), :to_s, :titleize, :prompt => true %>
<%= f.submit %>
</div>
<button id="color-button">Take the challenge!</button>
//script
$('color-button').observe('click', function(){
$('favorite-color').show();
});
Walter
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to
rubyonra...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/04c28d9a2ee2a59cb2c415eb9dab5b4d%40ruby-forum.com.
> For more options, visit
https://groups.google.com/groups/opt_out.