Sha256: 4b54cda14a6ca6888d325fc953b7eff608bc01172ceb97bdfd2297c46fdfbc6b
Contents?: true
Size: 1.81 KB
Versions: 2
Compression:
Stored size: 1.81 KB
Contents
module LesliCalendar class CalendarsController < ApplicationController before_action :set_calendar, only: [:show, :edit, :update] # GET /calendars def index respond_to do |format| format.html { } format.json do respond_with_pagination(LesliCalendar::CalendarService.new(current_user).index(@query)) end end end # GET /calendars/1 def show respond_to do |format| format.html { } format.json { respond_with_successful(@calendar.show()) } #format.json { respond_with_successful(@calendar.show(@query)) } end end # GET /calendars/new def new end # GET /calendars/1/edit def edit end # POST /calendars def create end # PATCH/PUT /calendars/1 def update end # DELETE /calendars/1 def destroy end def options respond_with_successful(Calendar.options(current_user, @query)) end def sync respond_with_successful(Calendar.sync(current_user)) end private # Sets the requested user based on the current_users's account def set_calendar if params[:id].blank? || params[:id] == "default" @calendar = CalendarService.new(current_user,query).find_default elsif params[:id] @calendar = CalendarService.new(current_user).find(params[:id]) end return respond_with_not_found unless @calendar end # Only allow a trusted parameter "white list" through. def calendar_params params.require(:calendar) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
lesli_calendar-0.2.2 | app/controllers/lesli_calendar/calendars_controller.rb |
lesli_calendar-0.2.1 | app/controllers/lesli_calendar/calendars_controller.rb |