Class: Ferret::Browser::TermController

Inherits:
Controller
  • Object
show all
Defined in:
lib/ferret/browser.rb

Constant Summary

Constants inherited from Controller

Controller::APP_DIR, Controller::STATIC_DIR

Instance Method Summary collapse

Methods inherited from Controller

#initialize, #method_missing

Methods included from ViewHelper

#tick_or_cross, #truncate

Constructor Details

This class inherits a constructor from Ferret::Browser::Controller

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Ferret::Browser::Controller

Instance Method Details

#show(field) ⇒ Object



223
224
225
226
227
228
229
# File 'lib/ferret/browser.rb', line 223

def show(field)
  if field and field.length > 0
    @field = field.to_sym
    @terms = @reader.terms(@field).to_json(:fast)
  end
  render(:action => :index)
end

#termdocs(args) ⇒ Object



231
232
233
234
235
236
237
238
# File 'lib/ferret/browser.rb', line 231

def termdocs(args)
  args = args.split('/')
  @field = args.shift.intern
  @term = args.join('/')
  render(:action => :termdocs,
         :content_type => 'text/plain',
         :layout => false)
end