Add controller for lunches
This commit is contained in:
parent
2665250d32
commit
f837c730e6
12 changed files with 43 additions and 0 deletions
3
app/assets/javascripts/lunches.js.coffee
Normal file
3
app/assets/javascripts/lunches.js.coffee
Normal file
|
@ -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/
|
3
app/assets/stylesheets/lunches.css.scss
Normal file
3
app/assets/stylesheets/lunches.css.scss
Normal file
|
@ -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/
|
22
app/controllers/lunches_controller.rb
Normal file
22
app/controllers/lunches_controller.rb
Normal file
|
@ -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
|
2
app/helpers/lunches_helper.rb
Normal file
2
app/helpers/lunches_helper.rb
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
module LunchesHelper
|
||||||
|
end
|
|
@ -24,6 +24,7 @@
|
||||||
<li><%= link_to 'Home', root_path %></li>
|
<li><%= link_to 'Home', root_path %></li>
|
||||||
<% if current_user %>
|
<% if current_user %>
|
||||||
<li><%= link_to 'Friends', friendships_path %></li>
|
<li><%= link_to 'Friends', friendships_path %></li>
|
||||||
|
<li><%= link_to 'Lunches', lunches_path %></li>
|
||||||
<li><%= link_to 'Users', users_path %></li>
|
<li><%= link_to 'Users', users_path %></li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
0
app/views/lunches/edit.html.erb
Normal file
0
app/views/lunches/edit.html.erb
Normal file
0
app/views/lunches/index.html.erb
Normal file
0
app/views/lunches/index.html.erb
Normal file
0
app/views/lunches/new.html.erb
Normal file
0
app/views/lunches/new.html.erb
Normal file
0
app/views/lunches/show.html.erb
Normal file
0
app/views/lunches/show.html.erb
Normal file
|
@ -5,6 +5,7 @@ Rails.application.routes.draw do
|
||||||
|
|
||||||
resources :home, only: [ :show ]
|
resources :home, only: [ :show ]
|
||||||
resources :friendships, only: [ :index, :show, :create, :destroy ]
|
resources :friendships, only: [ :index, :show, :create, :destroy ]
|
||||||
|
resources :lunches
|
||||||
resources :sessions, only: [ :create, :destroy ]
|
resources :sessions, only: [ :create, :destroy ]
|
||||||
resources :users, only: [ :index, :show ]
|
resources :users, only: [ :index, :show ]
|
||||||
|
|
||||||
|
|
7
test/controllers/lunches_controller_test.rb
Normal file
7
test/controllers/lunches_controller_test.rb
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class LunchesControllerTest < ActionController::TestCase
|
||||||
|
# test "the truth" do
|
||||||
|
# assert true
|
||||||
|
# end
|
||||||
|
end
|
4
test/helpers/lunches_helper_test.rb
Normal file
4
test/helpers/lunches_helper_test.rb
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class LunchesHelperTest < ActionView::TestCase
|
||||||
|
end
|
Loading…
Reference in a new issue