Fix some project url building with identifiers

This commit was powered by @ulferts
pull/3200/head
Alexander Bach 9 years ago
parent 851f8bf3d1
commit c687c63c71
  1. 10
      app/controllers/projects_controller.rb
  2. 7
      app/views/projects/_edit.html.erb
  3. 2
      app/views/projects/_form.html.erb

@ -129,13 +129,15 @@ class ProjectsController < ApplicationController
end
def update
@project.safe_attributes = params[:project]
if validate_parent_id && @project.save
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
@altered_project = Project.find(@project.id)
@altered_project.safe_attributes = params[:project]
if validate_parent_id && @altered_project.save
@altered_project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_update)
redirect_to action: 'settings', id: @project
redirect_to action: 'settings', id: @altered_project
}
end
else

@ -26,9 +26,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= labelled_tabular_form_for @project do |f| %>
<% @altered_project ||= @project %>
<%= labelled_tabular_form_for @altered_project, url: project_path(@project) do |f| %>
<%= render partial: 'form', locals: { f: f,
project: @project,
project: @altered_project,
renderTypes: false } %>
<%= f.button l(:button_save), class: 'button -highlight -with-icon icon-yes' %>

@ -27,7 +27,7 @@ See doc/COPYRIGHT.rdoc for more details.
++#%>
<%= error_messages_for 'project' %>
<%= error_messages_for project %>
<!--[form:project]-->

Loading…
Cancel
Save