Skip to content

Instantly share code, notes, and snippets.

@px-amaac
Created October 27, 2013 21:12
Show Gist options
  • Save px-amaac/7187960 to your computer and use it in GitHub Desktop.
Save px-amaac/7187960 to your computer and use it in GitHub Desktop.
<%= f.fields_for :urls do |url_fields| %>
<div class="field">
<%= f.label :url %><br>
<%= url_fields.text_field :url %>
</div>
<% end %>
def new
@digital_object_identifier = current_user.digital_object_identifiers.build
@digital_object_identifier.urls << Url.new
end
"urls_attr
ibutes"=>{"0"=>{"url"=>"www.something.com"}}}, "commit"=>"Create Digital object
identifier"}
←[1m←[35mUser Load (1.0ms)←[0m SELECT "users".* FROM "users" WHERE "users"."i
d" = 2 ORDER BY "users"."id" ASC LIMIT 1
Unpermitted parameters: urls_attributes
params.require(:digital_object_identifier).permit(:string_identifier, :integer_identifier, :description, url_attributes: [ :url ] )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment