I want to change parts of this form in order to use default values (with
a
disabled input). The problem is if I change it from text_field to
text_field_tag that part of the form stops functioning. It seems like a
silly question, but its been driving me crazy. Any help would help.
Steve.
<%= error_messages_for ‘post’ %>
Title
<%= text_field 'post', 'title' %>
Author's Name
<%= text_field 'post', 'author_name' %>
Permalink
<%= text_field 'post', 'permalink' %>
Influence level
<%= text_field 'post', 'influence_level' %>
Disclosure
<%= text_area 'post', 'disclosure' %>
–
View this message in context:
http://www.nabble.com/A-quick-question-on-forms-tf1958604.html#a5372587
Sent from the RubyOnRails Users forum at Nabble.com.
SSpalding wrote:
I want to change parts of this form in order to use default values (with
a
disabled input). The problem is if I change it from text_field to
text_field_tag that part of the form stops functioning. It seems like a
silly question, but its been driving me crazy. Any help would help.
Steve.
<%= error_messages_for ‘post’ %>
Title
<%= text_field 'post', 'title' %>
well to give this a set value and make it read only, change it to:
<%= text_field ‘post’, ‘title’, :value => “This is the title that
appears”, :readonly => true %>
or you could make it a hidden field:
<%= hidden_field ‘post’, ‘title’, :value => “You won’t see this but it
will get passed to the destination as params[:post].title” %>
Hope that works!
Ben L.
Thanks so much, that worked!
View this message in context:
http://www.nabble.com/A-quick-question-on-forms-tf1958604.html#a5379912
Sent from the RubyOnRails Users forum at Nabble.com.