From f837c730e6aa60f314fb42e03f8b362334b3d636 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Thu, 6 Nov 2014 13:52:28 -0500 Subject: [PATCH] Add controller for lunches --- app/assets/javascripts/lunches.js.coffee | 3 +++ app/assets/stylesheets/lunches.css.scss | 3 +++ app/controllers/lunches_controller.rb | 22 +++++++++++++++++++++ app/helpers/lunches_helper.rb | 2 ++ app/views/layouts/application.html.erb | 1 + app/views/lunches/edit.html.erb | 0 app/views/lunches/index.html.erb | 0 app/views/lunches/new.html.erb | 0 app/views/lunches/show.html.erb | 0 config/routes.rb | 1 + test/controllers/lunches_controller_test.rb | 7 +++++++ test/helpers/lunches_helper_test.rb | 4 ++++ 12 files changed, 43 insertions(+) create mode 100644 app/assets/javascripts/lunches.js.coffee create mode 100644 app/assets/stylesheets/lunches.css.scss create mode 100644 app/controllers/lunches_controller.rb create mode 100644 app/helpers/lunches_helper.rb create mode 100644 app/views/lunches/edit.html.erb create mode 100644 app/views/lunches/index.html.erb create mode 100644 app/views/lunches/new.html.erb create mode 100644 app/views/lunches/show.html.erb create mode 100644 test/controllers/lunches_controller_test.rb create mode 100644 test/helpers/lunches_helper_test.rb diff --git a/app/assets/javascripts/lunches.js.coffee b/app/assets/javascripts/lunches.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/lunches.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/lunches.css.scss b/app/assets/stylesheets/lunches.css.scss new file mode 100644 index 0000000..d8f926d --- /dev/null +++ b/app/assets/stylesheets/lunches.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Lunches controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/lunches_controller.rb b/app/controllers/lunches_controller.rb new file mode 100644 index 0000000..672d2c3 --- /dev/null +++ b/app/controllers/lunches_controller.rb @@ -0,0 +1,22 @@ +class LunchesController < ApplicationController + def index + end + + def show + end + + def new + end + + def create + end + + def edit + end + + def update + end + + def destroy + end +end diff --git a/app/helpers/lunches_helper.rb b/app/helpers/lunches_helper.rb new file mode 100644 index 0000000..15e3cd3 --- /dev/null +++ b/app/helpers/lunches_helper.rb @@ -0,0 +1,2 @@ +module LunchesHelper +end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index bff582b..653df4b 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -24,6 +24,7 @@
  • <%= link_to 'Home', root_path %>
  • <% if current_user %>
  • <%= link_to 'Friends', friendships_path %>
  • +
  • <%= link_to 'Lunches', lunches_path %>
  • <%= link_to 'Users', users_path %>
  • <% end %> diff --git a/app/views/lunches/edit.html.erb b/app/views/lunches/edit.html.erb new file mode 100644 index 0000000..e69de29 diff --git a/app/views/lunches/index.html.erb b/app/views/lunches/index.html.erb new file mode 100644 index 0000000..e69de29 diff --git a/app/views/lunches/new.html.erb b/app/views/lunches/new.html.erb new file mode 100644 index 0000000..e69de29 diff --git a/app/views/lunches/show.html.erb b/app/views/lunches/show.html.erb new file mode 100644 index 0000000..e69de29 diff --git a/config/routes.rb b/config/routes.rb index b15e310..199d3fa 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,6 +5,7 @@ Rails.application.routes.draw do resources :home, only: [ :show ] resources :friendships, only: [ :index, :show, :create, :destroy ] + resources :lunches resources :sessions, only: [ :create, :destroy ] resources :users, only: [ :index, :show ] diff --git a/test/controllers/lunches_controller_test.rb b/test/controllers/lunches_controller_test.rb new file mode 100644 index 0000000..dd0cbad --- /dev/null +++ b/test/controllers/lunches_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class LunchesControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/helpers/lunches_helper_test.rb b/test/helpers/lunches_helper_test.rb new file mode 100644 index 0000000..745a4ef --- /dev/null +++ b/test/helpers/lunches_helper_test.rb @@ -0,0 +1,4 @@ +require 'test_helper' + +class LunchesHelperTest < ActionView::TestCase +end