Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (initial_text = initial_text.to_i) if /\A\d+\z/.match(initial_text)
- case initial_text
- when COUNTRIES.keys
- session[:country_code] = initial_text
- next_url = '/find_by_country.json.json'
- when THEMES.keys
- session[:country_code] = initial_text
- next_url = '/find_by_theme.json.json'
- when 1
- next_url = '/find_by_project_id.json'
- when 2
- next_url = '/find_by_country.json'
- when 3
- next_url = '/find_by_theme.json'
- when 13..9999
- # This is likely a project id, so let's route them there.
- session[:project_id] = initial_text.to_i
- next_url = '/find_by_project_id.json'
- else # do nothing
- end
Add Comment
Please, Sign In to add comment