adds proposal edit
This commit is contained in:
@@ -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
|
||||
|
||||
17
app/views/proposals/edit.html.erb
Normal file
17
app/views/proposals/edit.html.erb
Normal 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>
|
||||
Reference in New Issue
Block a user