paging and a little styling

This commit is contained in:
2015-09-21 20:40:07 -05:00
parent c425f63ee9
commit d123e63b76
18 changed files with 71 additions and 30 deletions

View File

@ -6,7 +6,7 @@ class PagesController < ApplicationController
def page
@page = Page.new
person = Person.find(params[:id])
person = Person.find_by(id: params[:id])
@people = Person.pageable
return if person.nil?
@ -15,5 +15,16 @@ class PagesController < ApplicationController
end
def send_page
page = Page.create page_params.merge(status: 'sent')
sms = ::SmsSender.new(to: page.to, message: page.message)
sms.send!
redirect_to list_pages_path, notice: "Page sent!"
end
private
def page_params
params.require(:page).permit(:message, :to, :person_id)
end
end