Object
# File lib/kaminari/helpers/sinatra_helpers.rb, line 48 def link_to_unless(condition, name, options = {}, html_options = {}, &block) options = url_for(options) if options.is_a? Hash if condition if block_given? block.arity <= 1 ? capture(name, &block) : capture(name, options, html_options, &block) else name end else link_to(name, options, html_options) end end
# File lib/kaminari/helpers/sinatra_helpers.rb, line 61 def params @current_params end
# File lib/kaminari/helpers/sinatra_helpers.rb, line 32 def render(*args) base = ActionView::Base.new.tap do |a| a.view_paths << File.expand_path('../../../../app/views', __FILE__) end base.render(*args) end
# File lib/kaminari/helpers/sinatra_helpers.rb, line 39 def url_for(params) extra_params = {} if page = params[@param_name] and page != 1 extra_params[@param_name] = page end query = @current_params.merge(extra_params) @current_path + (query.empty? ? '' : "?#{query.to_query}") end
Generated with the Darkfish Rdoc Generator 2.