Commit 8c5b79a923770195d5c6cb73ac1451df81351910

Authored by Martins Polakovs
1 parent cc539151

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
app/controllers/projects_controller.rb
... ... @@ -21,9 +21,10 @@ class ProjectsController < ProjectResourceController
21 21 @project = Project.create_by_user(params[:project], current_user)
22 22  
23 23 respond_to do |format|
  24 + flash[:notice] = 'Project was successfully created.' if @project.saved?
24 25 format.html do
25 26 if @project.saved?
26   - redirect_to(@project, notice: 'Project was successfully created.')
  27 + redirect_to @project
27 28 else
28 29 render action: "new"
29 30 end
... ...
app/views/projects/create.js.haml
1 1 - if @project.saved?
2 2 :plain
3   - location.href = "#{project_path(@project, notice: 'Project was successfully created.')}";
  3 + location.href = "#{project_path(@project)}";
4 4 - else
5 5 - if @project.git_error?
6 6 location.href = "#{errors_githost_path}";
... ...