Creating a variable via the form rails -
value variables written in variables @first_city, @last_city, @date_trip of controller. without creating object in database. pass values of these variables page. possible or not?
<%= form_for(@orders) |f| %> <p>Выберите маршрут</p> <%= f.select(:first_city, @city_select, :value => :first_city, prompt: "Откуда") %> <%= f.select(:last_city, @city_select, prompt: "Куда") %> <%= f.text_field :date_trip %><br> <%= f.submit "Дальше", class: "btn" %> <% end %>
yes.
however if state
form_for(@orders)
it automatically assume creating order.
however can
form_for @order, :url => {:action => "action"}
create own action , access values trough
order_params[]
and can whatever want data
hope helped
Comments
Post a Comment