ruby on rails - Simple Form drop down menu, string selection -
i use simple form rails 4 app.
i have show page in app identifier location:
<div class="datasubtextq">location: <span class="datasubtexta"> <% if @project.scope.try(:participant).try(:location_specific) == true %> <%= render @project.scope.try(:participant).try(:location) %> <% else %> <%= render :text => "remote participation sought" %> <% end %> </span> </div>
in form, ask users select location, follows:
<%= par.input :location, label: 'where participants take part in project?', label_html: {class: 'response-project'}, collection: [ "brisbane", "melbourne", "sydney" ], prompt: "choose one" %>
when test this, following error:
the partial name (brisbane) not valid ruby identifier; make sure partial name starts lowercase letter or underscore, , followed combination of letters, numbers , underscores.
how ask show form reflect location selection made in form?
thank you
if read error get, can see issue related try render partial not exists , ok, fix issue change
<%= render @project.scope.try(:participant).try(:location) %>
with
<%= @project.scope.try(:participant).try(:location) %>
Comments
Post a Comment