Sha256: 0dd8186276b49def6eef149d74b57e3db2b82f5d7476c1ac64c79a1b469a5cc1

Contents?: true

Size: 623 Bytes

Versions: 2

Compression:

Stored size: 623 Bytes

Contents

<%= "<% form_for([#{goal.backvar_tuple.join(',')}]) do |f| %%>" %>
<%= "<%= f.error_messages %%>" %>
<% goal.fields.each do |k, v| %>
  <div>
    <%= "    <%= f.label :#{k} %%>" %>
    <%= generator.field_string(k, v) %>
  </div>
<% end %>

<% keys_in_path = goal.resource_tuple.map {|x| generator.app.fetch_goal(x).s + "_id" } %>
<% goal.foreign_keys.reject {|x, v| keys_in_path.member?(x) }.each do |key, value| %>
  <div>
    <%= "    <%= f.label :#{key[0..-4]} %%>" %>
    <%= generator.field_string(key, "foreign_key") %>
  </div>
<% end %>

  <div>
    <%= "<%= f.submit 'Submit' %%>" %>
  </div>
<%= "<% end %%>" %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mattknox-goaloc-0.4.2 lib/goaloc/generators/rails/_form.html.erb
mattknox-goaloc-0.4.4 lib/goaloc/generators/rails/_form.html.erb