Commit 9477448ac0731fc1a79f4dd9432a08e34c5a7eba
Exists in
master
and in
4 other branches
Merge pull request #2023 from martinsp/master
fixes :notice after project is created in projects_controller
Showing
2 changed files
with
3 additions
and
2 deletions
Show diff stats
app/controllers/projects_controller.rb
@@ -21,9 +21,10 @@ class ProjectsController < ProjectResourceController | @@ -21,9 +21,10 @@ class ProjectsController < ProjectResourceController | ||
21 | @project = Project.create_by_user(params[:project], current_user) | 21 | @project = Project.create_by_user(params[:project], current_user) |
22 | 22 | ||
23 | respond_to do |format| | 23 | respond_to do |format| |
24 | + flash[:notice] = 'Project was successfully created.' if @project.saved? | ||
24 | format.html do | 25 | format.html do |
25 | if @project.saved? | 26 | if @project.saved? |
26 | - redirect_to(@project, notice: 'Project was successfully created.') | 27 | + redirect_to @project |
27 | else | 28 | else |
28 | render action: "new" | 29 | render action: "new" |
29 | end | 30 | end |
app/views/projects/create.js.haml
1 | - if @project.saved? | 1 | - if @project.saved? |
2 | :plain | 2 | :plain |
3 | - location.href = "#{project_path(@project, notice: 'Project was successfully created.')}"; | 3 | + location.href = "#{project_path(@project)}"; |
4 | - else | 4 | - else |
5 | - if @project.git_error? | 5 | - if @project.git_error? |
6 | location.href = "#{errors_githost_path}"; | 6 | location.href = "#{errors_githost_path}"; |