Permalink
Browse files

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
  • Loading branch information...
1 parent cc53915 commit 8c5b79a923770195d5c6cb73ac1451df81351910 @martinsp martinsp committed Nov 21, 2012
Showing with 3 additions and 2 deletions.
  1. +2 −1 app/controllers/projects_controller.rb
  2. +1 −1 app/views/projects/create.js.haml
@@ -21,9 +21,10 @@ def create
@project = Project.create_by_user(params[:project], current_user)
respond_to do |format|
+ flash[:notice] = 'Project was successfully created.' if @project.saved?
format.html do
if @project.saved?
- redirect_to(@project, notice: 'Project was successfully created.')
+ redirect_to @project
else
render action: "new"
end
@@ -1,6 +1,6 @@
- if @project.saved?
:plain
- location.href = "#{project_path(@project, notice: 'Project was successfully created.')}";
+ location.href = "#{project_path(@project)}";
- else
- if @project.git_error?
location.href = "#{errors_githost_path}";

0 comments on commit 8c5b79a

Please sign in to comment.