class KeywordsController < ApplicationController ChoicesFile='menus/keywordschoices.txt' def get_title 'select keywords for wikinext' end #enhances @choices with the text already typed def extras session[:choices]=(@choices << get_text.strip).uniq! reformat_choices end #adds the selected line to keywordschoices.txt #unless that is redundant def selected(str) session[:keywords]=str if !IO.read(ChoicesFile).match(str) File.open(ChoicesFile,'a') do |f| f.puts str end end end end