prevent pow to crash when no flash message (bug) + add api resources for pages
This commit is contained in:
parent
739d2db0a9
commit
0534c5504f
@ -22,12 +22,14 @@ class Locomotive::BasePresenter
|
||||
self.source.persisted? || self.source.embedded? ? self.source._id.to_s : nil
|
||||
end
|
||||
|
||||
alias :_id :id
|
||||
|
||||
def ability?
|
||||
self.ability.present?
|
||||
end
|
||||
|
||||
def included_methods
|
||||
%w(id created_at updated_at)
|
||||
%w(id _id created_at updated_at)
|
||||
end
|
||||
|
||||
def as_json(methods = nil)
|
||||
|
@ -67,6 +67,8 @@ Rails.application.routes.draw do
|
||||
|
||||
resources :snippets
|
||||
|
||||
resources :pages
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -45,8 +45,10 @@ module Locomotive
|
||||
set_flash_message!
|
||||
message = controller.flash[type]
|
||||
|
||||
controller.headers['X-Message'] = message
|
||||
controller.headers['X-Message-Type'] = type
|
||||
unless message.blank?
|
||||
controller.headers['X-Message'] = message
|
||||
controller.headers['X-Message-Type'] = type
|
||||
end
|
||||
|
||||
yield if block_given?
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user