diff --git a/app/assets/javascripts/pastes.js.coffee b/app/assets/javascripts/pastes.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/pastes.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/pastes.css.scss b/app/assets/stylesheets/pastes.css.scss new file mode 100644 index 0000000..fdb8ee3 --- /dev/null +++ b/app/assets/stylesheets/pastes.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the pastes 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/pastes_controller.rb b/app/controllers/pastes_controller.rb new file mode 100644 index 0000000..834c785 --- /dev/null +++ b/app/controllers/pastes_controller.rb @@ -0,0 +1,19 @@ +class PastesController < ApplicationController + def index + end + + def create + end + + def new + end + + def update + end + + def edit + end + + def destroy + end +end diff --git a/app/helpers/pastes_helper.rb b/app/helpers/pastes_helper.rb new file mode 100644 index 0000000..7372523 --- /dev/null +++ b/app/helpers/pastes_helper.rb @@ -0,0 +1,2 @@ +module PastesHelper +end diff --git a/app/views/pastes/edit.html.erb b/app/views/pastes/edit.html.erb new file mode 100644 index 0000000..e99d6e3 --- /dev/null +++ b/app/views/pastes/edit.html.erb @@ -0,0 +1 @@ +Edit diff --git a/app/views/pastes/index.html.erb b/app/views/pastes/index.html.erb new file mode 100644 index 0000000..8ab686e --- /dev/null +++ b/app/views/pastes/index.html.erb @@ -0,0 +1 @@ +Hello, World! diff --git a/app/views/pastes/new.html.erb b/app/views/pastes/new.html.erb new file mode 100644 index 0000000..96716fb --- /dev/null +++ b/app/views/pastes/new.html.erb @@ -0,0 +1 @@ +New diff --git a/config/routes.rb b/config/routes.rb index 4d3f6ff..1c202d9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,56 +1,4 @@ Tack2us::Application.routes.draw do - # The priority is based upon order of creation: first created -> highest priority. - # See how all your routes lay out with "rake routes". - - # You can have the root of your site routed with "root" - # root 'welcome#index' - - # Example of regular route: - # get 'products/:id' => 'catalog#view' - - # Example of named route that can be invoked with purchase_url(id: product.id) - # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase - - # Example resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Example resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Example resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Example resource route with more complex sub-resources: - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', on: :collection - # end - # end - - # Example resource route with concerns: - # concern :toggleable do - # post 'toggle' - # end - # resources :posts, concerns: :toggleable - # resources :photos, concerns: :toggleable - - # Example resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end + root to: "pastes#index" + resources :pastes end diff --git a/spec/controllers/pastes_controller_spec.rb b/spec/controllers/pastes_controller_spec.rb new file mode 100644 index 0000000..395ceb6 --- /dev/null +++ b/spec/controllers/pastes_controller_spec.rb @@ -0,0 +1,24 @@ +require 'spec_helper' + +describe PastesController do + describe "GET #index" do + it "renders the :index template" do + get :index + expect(response).to render_template("index") + end + end + + describe "GET #new" do + it "renders the :new template" do + get :new + expect(response).to render_template("new") + end + end + + describe "GET #edit" do + it "renders the :edit template" do + get :edit, id: 1 + expect(response).to render_template("edit") + end + end +end diff --git a/spec/helpers/pastes_helper_spec.rb b/spec/helpers/pastes_helper_spec.rb new file mode 100644 index 0000000..4e2758a --- /dev/null +++ b/spec/helpers/pastes_helper_spec.rb @@ -0,0 +1,4 @@ +require 'spec_helper' + +describe PastesHelper do +end