Commit 8c5b79a9 authored by Martins Polakovs's avatar Martins Polakovs

Fixes :notice after project is created

When projects were created in projects_controller
create.js.haml passed notice as url parameter and
therefore notice was not displayed in the page after
redirect to the project page
parent cc539151
...@@ -21,9 +21,10 @@ class ProjectsController < ProjectResourceController ...@@ -21,9 +21,10 @@ class ProjectsController < ProjectResourceController
@project = Project.create_by_user(params[:project], current_user) @project = Project.create_by_user(params[:project], current_user)
respond_to do |format| respond_to do |format|
flash[:notice] = 'Project was successfully created.' if @project.saved?
format.html do format.html do
if @project.saved? if @project.saved?
redirect_to(@project, notice: 'Project was successfully created.') redirect_to @project
else else
render action: "new" render action: "new"
end end
......
- if @project.saved? - if @project.saved?
:plain :plain
location.href = "#{project_path(@project, notice: 'Project was successfully created.')}"; location.href = "#{project_path(@project)}";
- else - else
- if @project.git_error? - if @project.git_error?
location.href = "#{errors_githost_path}"; location.href = "#{errors_githost_path}";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment