Mercurial > hg > soundsoftware-site
changeset 329:4575b631f6ce feature_36
DEV Commit: some work on the publications controller and views
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Tue, 29 Mar 2011 17:16:18 +0100 |
parents | aed18b463206 |
children | d750431a4102 |
files | vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb vendor/plugins/redmine_bibliography/app/views/publications/index.html.erb vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb vendor/plugins/redmine_bibliography/app/views/publications/show.html.erb |
diffstat | 4 files changed, 36 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Tue Mar 29 14:33:32 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/controllers/publications_controller.rb Tue Mar 29 17:16:18 2011 +0100 @@ -1,11 +1,15 @@ class PublicationsController < ApplicationController - unloadable - - def index + def new + @publication = Publication.new() end def create + @publication.save! + end + + def index + @publications = Publication.find(:all) end def edit @@ -13,4 +17,11 @@ def update end + + def show + @publication = Publication.find(params[id]) + @authors = @publication.authors + end + + end
--- a/vendor/plugins/redmine_bibliography/app/views/publications/index.html.erb Tue Mar 29 14:33:32 2011 +0100 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/index.html.erb Tue Mar 29 17:16:18 2011 +0100 @@ -1,1 +1,5 @@ <h2>Publications#index</h2> + +<% @publications.each do |publication| %> + <%= publication.id %> +<% end %> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/plugins/redmine_bibliography/app/views/publications/new.html.erb Tue Mar 29 17:16:18 2011 +0100 @@ -0,0 +1,16 @@ +<h1>New Publication</h1> + +<% form_for(@publication) do |f| %> + <% f.error_messages %> + + <p> + <%= f.label :title %> + <%= f.text_field :title %> + </p> + + <p><% f.submit "Create" %></p> + +<% end %> + + +