Revision 425:4ecbc22579e2 vendor/plugins/redmine_bibliography/app/controllers

View differences:

vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb
1 1
# vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb
2 2

  
3 3
class PublicationsController < ApplicationController
4
  # TODO: should be removed on production version?
5
  unloadable
4 6

  
5 7
  def new
6 8
    # we always try to create at least one publication
......
61 63

  
62 64
  end
63 65

  
64
  def show  
65
    @publication = Publication.find(params[id])
66
    @authors = @publication.authors
66
  def show
67
    @publication = Publication.find_by_id(params[:id])
68

  
69
    if @publication.nil?
70
        @publications = Publication.all
71
        render "index", :alert => 'Your Publications was not found!'
72
    else
73
      @authors = @publication.authors
74
      @bibtext_entry = @publication.bibtex_entry
75
    
76
      respond_to do |format|
77
        format.html
78
        format.xml {render :xml => @publication}
79
      end
80
    end
67 81
  end
68 82

  
69 83
  # parse string with bibtex authors

Also available in: Unified diff