Class AbcdController
In: app/controllers/abcd_controller.rb
Parent: ApplicationController

Methods

Public Instance methods

[Source]

    # File app/controllers/abcd_controller.rb, line 49
49:         def backspace
50:                 session[:text].chop!
51:         redirect_to :action => "index"
52:         end

[Source]

    # File app/controllers/abcd_controller.rb, line 22
22:         def extras
23:                 @text=get_text
24:                 lw=last_word(@text.strip)
25:                 if lw.empty?
26:                         @words=Giver.new.
27:                                 get_starting_words(SentencesDir)
28:                          #word candidates
29:                 else
30:                         rx_str=lw.split("").join(".*")
31:                         rx=Regexp.new(rx_str,Regexp::IGNORECASE)
32: #                       logger.info("words rx:"+rx_str)
33:                         g=Giver.new
34:                         @words=g.get_matching_words(WordsDir,rx) - [lw]
35:                         @words.sort! { |x,y| x.size <=> y.size }
36:                 end
37:         end

[Source]

   # File app/controllers/abcd_controller.rb, line 2
2:         def first_time
3:                 session[:choices]= nil
4:                 session[:selected_item]=0
5:         redirect_to :action => "index"
6:         end

[Source]

    # File app/controllers/abcd_controller.rb, line 10
10:         def get_separator
11:                 '|'
12:         end

[Source]

   # File app/controllers/abcd_controller.rb, line 7
7:         def get_title
8:                 'type'
9:         end

[Source]

    # File app/controllers/abcd_controller.rb, line 38
38:         def replace
39:                 @text=get_text.strip
40:                 st=params[:id]
41:                 if last_word(@text).empty?
42:                         session[:text]=@text+ " #{st} "
43:                 else
44:                         @text.gsub!(/\w+$/,st)
45:                         session[:text]=@text+' '
46:                 end
47:         redirect_to :action => "index"
48:         end

[Source]

    # File app/controllers/abcd_controller.rb, line 17
17:         def selected(str)
18:                 str.gsub!(/_/," ")
19:                 session[:text]<< str
20:                 session[:choices]=nil
21:         end

[Source]

    # File app/controllers/abcd_controller.rb, line 13
13:         def start_choices
14:                 ['a|b|c|d|_|!','e|f|g|h|.|,','i|j|k|l|m|n',
15:                         'o|p|q|r|s|t','u|v|w|x|y|z','*|+|?|^|$|\|']
16:         end

[Validate]