adds proposal edit

This commit is contained in:
rgarcia
2015-09-12 12:35:54 +02:00
parent 922d3f1b24
commit 845ca22152
2 changed files with 31 additions and 0 deletions

View File

@@ -32,6 +32,20 @@ class ProposalsController < ApplicationController
end
end
def edit
load_featured_tags
end
def update
@proposal.assign_attributes(proposal_params)
if @proposal.save_with_captcha
redirect_to @proposal, notice: t('flash.actions.update.notice', resource_name: 'Proposal')
else
load_featured_tags
render :edit
end
end
private
def proposal_params

View File

@@ -0,0 +1,17 @@
<div class="proposal-edit row">
<div class="small-12 column">
<%= link_to proposals_path, class: "left back clear" do %>
<i class="icon-angle-left left"></i>
<%= t("proposals.edit.back_link") %>
<% end %>
<div class="right">
<%= link_to t("proposals.edit.show_link"), @proposal %>
</div>
<h1><%= t("proposals.edit.editing") %></h1>
<%= render "form" %>
</div>
</div>