ruby - Force return after render in rails controller? -
using rails 4.2.1
i want write function forces controller called in render , return. possible?
def error! # stuff define error # render error render end def somecontroller < actioncontroller::metal include abstractcontroller::rendering include actioncontroller::rendering include abstractcontroller::callbacks include actioncontroller::renderers::all include actioncontroller::implicitrender def some_action if # - continue else # bad - error! error! # how force controller stop execution , return here? # return error! # # in error! function? end puts 'still running' end end
check
def some_action if # - continue else return error! end puts 'still running' end
another option raise exception within error!
, , have rescue_from block @ applicationcontroller
level
Comments
Post a Comment