Skip to content

Commit b722496

Browse files
committed
Raise error if user tries to use Rabl but they haven't included it in their Gemfile.
1 parent 847a63d commit b722496

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/gon.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ def set_variable(name, value)
6060
end
6161

6262
def rabl(view_path, options = {})
63+
if !defined?(Gon::Rabl)
64+
raise NoMethodError.new('You should define Rabl in your Gemfile')
65+
end
6366
rabl_data = Gon::Rabl.parse_rabl(view_path, options[:controller] ||
6467
@request_env['action_controller.instance'] ||
6568
@request_env['action_controller.rescue.response'].

0 commit comments

Comments
 (0)