# HG changeset patch # User luisf # Date 1307021951 -3600 # Node ID 27930c9b424dfda327b9c0684a3f86b2bd43ed15 # Parent 9cfd7a1d848ea485a3b7c736625952e0978344d3 update method in publications controller; updated view diff -r 9cfd7a1d848e -r 27930c9b424d vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb --- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Wed Jun 01 17:27:52 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Thu Jun 02 14:39:11 2011 +0100 @@ -54,14 +54,17 @@ def edit @publication = Publication.find(params[:id]) - - + end def update - - logger.error "AAAA update" - + @publication = Publication.find(params[:id]) + if @publication.update_attributes(params[:publication]) + flash[:notice] = "Successfully updated Publication." + redirect_to @publication + else + render :action => 'edit' + end end def show diff -r 9cfd7a1d848e -r 27930c9b424d vendor/plugins/redmine_bibliography/app/views/publications/edit.html.erb --- a/vendor/plugins/redmine_bibliography/app/views/publications/edit.html.erb Wed Jun 01 17:27:52 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/edit.html.erb Thu Jun 02 14:39:11 2011 +0100 @@ -1,49 +1,9 @@

Publications#edit

-<% form_for @publication, :url => {:action => :edit} do |f| -%> - <%= f.error_messages %> -

- <%= f.label :title, l(:title) %> <%= f.text_field :title %> -

- +<%= render :partial => 'edit' %> -

<%= l(:authors) -%>

- - <% f.fields_for :authors do |author| %> -

- <%= author.label :name, l("name") %> <%= author.text_field :name %> -

- - <% end %> - - - <% f.fields_for @publication.bibtex_entry do |b| -%> -

- <%= b.label :year, l(:year) %> <%= b.text_field :year %> -

-

- <%= b.label :chapter, l(:chapter) %> <%= b.text_field :chapter %> -

-

- <%= b.label :editor, l(:editor) %> <%= b.text_field :editor %> -

-

- <%= b.label :booktitle, l(:booktitle) %> <%= b.text_field :booktitle %> -

-

- <%= b.label :publisher, l(:publisher) %> <%= b.text_field :publisher %> -

-

- <%= b.label :pages, l(:pages) %> <%= b.text_field :pages %> -

- <% end -%> +

+ <%= link_to :show %>

- <%= f.submit "Submit" %> - - - - - -<% end -%> \ No newline at end of file