Skip to content

Commit

Permalink
Adding and deleting reward conditions from reward page
Browse files Browse the repository at this point in the history
you can now edit rewards and reward conditions from the same page
  • Loading branch information
Tylerc230 committed Jan 5, 2012
1 parent 3f5c221 commit 636cb1a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions app/admin/reward_conditions.rb
@@ -1,9 +1,9 @@
ActiveAdmin.register RewardCondition do
menu false
member_action :delete do
reward_condition = RewardCondition.find(params[:id])
reward_condition.delete
redirect_to :action => :show
end
#member_action :delete do
# reward_condition = RewardCondition.find(params[:id])
# reward_condition.delete
# redirect_to :back
#end

end
3 changes: 2 additions & 1 deletion app/views/admin/rewards/_form.html.erb
Expand Up @@ -6,8 +6,9 @@
<%= reward_condition.input :condition_type %>
<%= reward_condition.input :value %>
<%= reward_condition.input :id %>
<%= link_to 'Delete', :controller => 'reward_conditions', :action => 'delete', :id => reward_condition.object.id %>
<%= link_to 'Delete', admin_reward_condition_path(reward_condition.object), :method => :delete, :confirm => 'Are you sure you want to delete this condition?' %>
<% end %>
<%= link_to 'New Reward Condition', new_admin_reward_condition_path %>
<% end %>
<%= f.buttons do %>
<%= f.commit_button %>
Expand Down

0 comments on commit 636cb1a

Please sign in to comment.