Advertisement
dmontal2

rails_simple_calendar

Aug 29th, 2016
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.67 KB | None | 0 0
  1. #application_controller.rb
  2. class ApplicationController < ActionController::Base
  3.   include Clearance::Controller
  4.   # Prevent CSRF attacks by raising an exception.
  5.   # For APIs, you may want to use :null_session instead.
  6.   protect_from_forgery with: :exception
  7.  
  8.   # def url_after_denied_access_when_signed_out
  9.   #   '/'
  10.   #end
  11.  
  12.   #CALENDAR STUFF
  13.   #attr_accessible :name, :start_time
  14.  
  15.    def start_time
  16.     event_start_time
  17.    end
  18.  
  19.   def calendar
  20.     @events = Event.all
  21.   end
  22.  
  23. end
  24.  
  25.  
  26. #calendar.html.erb
  27. <div class="page-header"><h1>Calendar</h1></div>
  28.  
  29. <%= calendar @events do |event| %>
  30.   <div><%= link_to event.title, event %></div>
  31. <% end %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement