Skip to content

Instantly share code, notes, and snippets.

@BigMcLargeHuge
Last active August 29, 2015 14:22
Show Gist options
  • Save BigMcLargeHuge/9807aa65106892a70321 to your computer and use it in GitHub Desktop.
Save BigMcLargeHuge/9807aa65106892a70321 to your computer and use it in GitHub Desktop.
Using variables to define input params
Say I have a variable @field and I set @field=username. How could I use it to define the parameter :username in the input below?
<%= simple_form_for @user do |f| %>
<%= f.input :username, hint: 'You cannot change your username.' %>
<%= f.button :submit %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment