Method: LogicalModel::UrlHelper::ClassMethods#do_with_resource_path

Defined in:
lib/logical_model/url_helper.rb

#do_with_resource_path(new_path) ⇒ Object

Requests done within the block will go to new path.

Examples:

@resource_path # '/comments'
do_with_resource_path("users/#{@user_id}/#{@resource_path}"}/") do
  @resource_path # '/users/23/comments'
end

Parameters:

  • new_path (String)


84
85
86
87
88
89
# File 'lib/logical_model/url_helper.rb', line 84

def do_with_resource_path(new_path)
  bkp_path = @resource_path
  @resource_path = new_path
  yield
  @resource_path = bkp_path
end