Re: [Rails] Re: Combo Box in rails and save 2 value in diffrent field in one field at database
On 15 December 2012 12:34, Mas Bejo <lists@ruby-forum.com> wrote:
> i get this syntax
>
> <%=select_tag :Status, options_for_select(%w{ Perempuan Laki-Laki
> })%>
>
> but, i didn't work, i just need to get value from that combobox, and
> send it to query insert to field "Status" in database, but when i try
> rails look it like null value
First you need to determine which area is going wrong.
Firstly is the html that is being generated what you expect. Have a
look at the html of the page (using View > Page Source or similar in
your browser). Does that look ok?
Secondly perhaps the data is not being sent to the server correctly.
Look in log/development.log to check that the data is being passed and
the correct action is being called.
Thirdly perhaps there is an error in the action in the controller.
Have a look at the Rails Guide on Debugging and it will show you
techniques you can use to debug your code.
>
> ----------------------------
>
> and for second problem, i get this syntax.
>
> <div class="field">
> <%= f.label :ttl %></td><td>
> <%= f.label :":" %></td><td>
> <%= f.text_field :TTL %>
> <tr>
> <td colspan="3" align="right">
> <%= select_date %></td></tr>
> </div>
>
> i want to concate value from "<%= f.text_field :TTL %>" and value from
> "<%= select_date %>" and send it to update field TTL in database
It is really better to only have one question at a time, otherwise the
answers will get confusing.
Colin
--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home