Skip to content

Commit

Permalink
Merge pull request #2023 from martinsp/master
Browse files Browse the repository at this point in the history
fixes :notice after project is created in projects_controller
  • Loading branch information
dzaporozhets committed Nov 21, 2012
2 parents 6bf6569 + 8c5b79a commit 9477448
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/controllers/projects_controller.rb
Expand Up @@ -21,9 +21,10 @@ def create
@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
Expand Down
2 changes: 1 addition & 1 deletion app/views/projects/create.js.haml
@@ -1,6 +1,6 @@
- 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}";
Expand Down

0 comments on commit 9477448

Please sign in to comment.