# HG changeset patch # User luisf # Date 1308227614 -3600 # Node ID 0f909724575681db5e00b536a0bd35f0d832660e # Parent f2288bb384bb96d866dc6dc8fc17c61a7afb4064 After creating a publication in the project scope, correctly redirects to the Show action (still in the project's scope). diff -r f2288bb384bb -r 0f9097245756 vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb --- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Wed Jun 15 17:40:18 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Thu Jun 16 13:33:34 2011 +0100 @@ -17,7 +17,7 @@ @project_id = params[:project_id] # the step we're at in the form - @publication.current_step = session[:publication_step] + # @publication.current_step = session[:publication_step] @new_publications = [] session[:publications] ||= {} @@ -34,7 +34,7 @@ if @publication.save flash[:notice] = "Successfully created publication." - redirect_to @publication + redirect_to :action => :show, :id => @publication, :project_id => @project.id else render :action => 'new' end @@ -187,9 +187,14 @@ private - def find_projectx - # @project variable must be set before calling the authorize filter - @project = Project.find(params[:project_id]) - end - + # TODO: luisf. - only here for debugging purposes + # Find project of id params[:project_id] + def find_project_by_project_id + + logger.error { "FIND PROJECT BY PROJECT ID" } + + @project = Project.find(params[:project_id]) + rescue ActiveRecord::RecordNotFound + render_404 + end end