From b84b83fc137e7d32b4c6b41646559a25d1c94fc9 Mon Sep 17 00:00:00 2001 From: "Evan R. Murphy" Date: Sun, 14 Nov 2010 06:18:06 -0600 Subject: [PATCH] Start on entries controller and views --- app/controllers/entries_controller.rb | 18 ++++++++++++++++++ app/helpers/entries_helper.rb | 2 ++ app/views/entries/create.html.erb | 2 ++ app/views/entries/destroy.html.erb | 2 ++ app/views/shared/_entry_form.html.haml | 10 ++++++++++ app/views/shared/_error_messages.html.haml | 1 + 6 files changed, 35 insertions(+) create mode 100644 app/controllers/entries_controller.rb create mode 100644 app/helpers/entries_helper.rb create mode 100644 app/views/entries/create.html.erb create mode 100644 app/views/entries/destroy.html.erb create mode 100644 app/views/shared/_entry_form.html.haml create mode 100644 app/views/shared/_error_messages.html.haml diff --git a/app/controllers/entries_controller.rb b/app/controllers/entries_controller.rb new file mode 100644 index 0000000..f6975e4 --- /dev/null +++ b/app/controllers/entries_controller.rb @@ -0,0 +1,18 @@ +class EntriesController < ApplicationController + + def new + end + + # def create + # @entry = current_user.entries.build(params[:entry]) + # if @entry.save + # flash[:success] = "Entry created!" + # redirect_to root_path + # else + # render 'pages/home' + # end + # end + + def destroy + end +end diff --git a/app/helpers/entries_helper.rb b/app/helpers/entries_helper.rb new file mode 100644 index 0000000..ed8c595 --- /dev/null +++ b/app/helpers/entries_helper.rb @@ -0,0 +1,2 @@ +module EntriesHelper +end diff --git a/app/views/entries/create.html.erb b/app/views/entries/create.html.erb new file mode 100644 index 0000000..2eadd31 --- /dev/null +++ b/app/views/entries/create.html.erb @@ -0,0 +1,2 @@ +

Entries#create

+

Find me in app/views/entries/create.html.erb

diff --git a/app/views/entries/destroy.html.erb b/app/views/entries/destroy.html.erb new file mode 100644 index 0000000..45d6b6c --- /dev/null +++ b/app/views/entries/destroy.html.erb @@ -0,0 +1,2 @@ +

Entries#destroy

+

Find me in app/views/entries/destroy.html.erb

diff --git a/app/views/shared/_entry_form.html.haml b/app/views/shared/_entry_form.html.haml new file mode 100644 index 0000000..109cde2 --- /dev/null +++ b/app/views/shared/_entry_form.html.haml @@ -0,0 +1,10 @@ += form_for @entry do |f| + -# = render 'shared/error_messages', :object => f.object + .word + = f.label :word + = f.text_field :word + .definition + = f.label :definition + = f.text_area :definition + .actions + = f.submit "Add to dictionary" diff --git a/app/views/shared/_error_messages.html.haml b/app/views/shared/_error_messages.html.haml new file mode 100644 index 0000000..60f48b7 --- /dev/null +++ b/app/views/shared/_error_messages.html.haml @@ -0,0 +1 @@ +-# Shared partial goes here