Class | KeywordsController |
In: |
app/controllers/keywords_controller.rb
|
Parent: | ApplicationController |
ChoicesFile | = | 'menus/keywordschoices.txt' |
enhances @choices with the text already typed
# File app/controllers/keywords_controller.rb, line 7 7: def extras 8: session[:choices]=(@choices << 9: get_text.strip).uniq! 10: reformat_choices 11: end
# File app/controllers/keywords_controller.rb, line 3 3: def get_title 4: 'select keywords for wikinext' 5: end
adds the selected line to keywordschoices.txt unless that is redundant
# File app/controllers/keywords_controller.rb, line 14 14: def selected(str) 15: session[:keywords]=str 16: if !IO.read(ChoicesFile).match(str) 17: File.open(ChoicesFile,'a') do |f| 18: f.puts str 19: end 20: end 21: end