Class: OutroRails::Chords::PickersController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- OutroRails::Chords::PickersController
- Defined in:
- app/controllers/outro_rails/chords/pickers_controller.rb
Instance Method Summary collapse
Instance Method Details
#show ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/controllers/outro_rails/chords/pickers_controller.rb', line 6 def show query = params[:q].to_s.strip return redirect_to chords_path if query.empty? chord = Chord.where(slug: lookup_candidates(query)).first if chord redirect_to chord_path(chord) else redirect_to chords_path(missing: query) end end |