I use simple form with my rails 4 app.
I have a show page in my app with this identifier for 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 my form, I ask users to select a location, as follows:
<%= par.input :location, label: 'Where will participants take part in this project?', label_html: {class: 'response-project'}, collection: [ "Brisbane", "Melbourne", "Sydney" ], prompt: "Choose one" %>
When I test this, I get the following error:
The partial name (Brisbane) is not a valid Ruby identifier; make sure your partial name starts with a lowercase letter or underscore, and is followed by any combination of letters, numbers and underscores.
How do I ask for the show form to reflect the location selection made in the form?
Thank you
If you read the error you get, you can see the issue is related to try to render a partial that does not exists and is ok, to fix the issue change
<%= render @project.scope.try(:participant).try(:location) %>
with
<%= @project.scope.try(:participant).try(:location) %>
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments