Skip to content

Commit

Permalink
Fix errors with nested resources
Browse files Browse the repository at this point in the history
  • Loading branch information
vera committed Jul 26, 2016
1 parent 09d4b55 commit 4439665
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@

# Ignore uploads
/public/uploads

.byebug_history
2 changes: 1 addition & 1 deletion app/views/ideas/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%= form_for [@idea, @category] do |f| %>
<%= form_for form_params do |f| %>
<% if @idea.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@idea.errors.count, "error") %> prohibited this idea from being saved:</h2>
Expand Down
2 changes: 1 addition & 1 deletion app/views/ideas/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h1>Editing Idea</h1>

<%= render 'form' %>
<%= render partial: 'form', locals: {form_params: [@idea]} %>

<%= link_to 'Show', @idea %> |
<%= link_to 'Back', root_path %>
2 changes: 1 addition & 1 deletion app/views/ideas/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1>New Idea</h1>

<%= render 'form' %>
<%= render partial: 'form', locals: {form_params: [@category, @idea]} %>

<%= link_to 'Back', root_path %>
2 changes: 1 addition & 1 deletion app/views/shared/_category_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<%= link_to category.name, category_ideas_path(category) %>
</th>
<th class="cat button-s right">
<%= link_to new_category_idea_path(category, idea) do %><span class="glyphicon glyphicon-plus"></span><% end %>
<%= link_to new_category_idea_path(category) do %><span class="glyphicon glyphicon-plus"></span><% end %>
<%= link_to category, method: :delete, data: { confirm: 'Are you sure?' } do %><span class="glyphicon glyphicon-remove"></span><% end %>
</th>
</tr>

0 comments on commit 4439665

Please sign in to comment.