Thiti Panya wrote:
i create drop-down memu for organelle by using select_tag but problem
is
can't get value for form select_tag to database seqfeature but
form.text_field ,it's work , i don't understand
why? pls help me
##############################################################
code for veiw.rhtm:
<% form_for :seqfeature do |form| %>
<div class="form_row">
<label for="seq_name">Sequence Name :</label>
<%= form.text_field :seq_name %>
</div>
<div class="form_row">
<label for="organelle">Organelle </label>
<%= select_tag "organelle" , options_for_select(["",
"mitochondrion", "nucleomorph", "plastid", "mitochondrion: kinetoplast",
"plastid: chloroplast", "plastid: apicoplast", "plastid: chromoplast",
"plastid: cyanelle", "plastid: leucoplast", "plastid: protoplastid" ])
%>
</div>
<%= submit_tag "Submit !", :class => "submit" %>
<% end %>
########################################################################
code for submit controller:
class SubmitController < ApplicationController
def view
if request.post? and params[:seqfeature]
@seqfeature = Seqfeature.new(params[:seqfeature])
if @seqfeature.save
render :text => "sequence submitted"
end
end
end
end
##### the vale from form insert to table seqfeatures but i can't get
value
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---