Skip to content
Browse files

Merge pull request #2023 from martinsp/master

fixes :notice after project is created in projects_controller
  • Loading branch information...
2 parents 6bf6569 + 8c5b79a commit 9477448ac0731fc1a79f4dd9432a08e34c5a7eba @randx randx 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
View
3 app/controllers/projects_controller.rb
@@ -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
View
2 app/views/projects/create.js.haml
@@ -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 9477448

Please sign in to comment.
Something went wrong with that request. Please try again.