Class WordsController
In: app/controllers/words_controller.rb
Parent: ApplicationController

Methods

Public Instance methods

[Source]

    # File app/controllers/words_controller.rb, line 54
54:   def conditions_for_collection
55:     [
56: #      'words.language_id = ? and definitions.language_id = ?', 
57: #      [
58: #        session[:language_dictionary_id]
59: #      ],
60: #      [
61: #        session[:language_target_id]
62: #      ]      
63:       'words.language_id = ?', 
64:       [
65:         session[:language_dictionary_id]
66:       ]    
67:     ]
68:   end

[Source]

    # File app/controllers/words_controller.rb, line 70
70:   def word_of_moment
71:     if params[:id]
72:       @word = Word.find_by_id(params[:id])
73:     else
74:       @word = Word.get_word_of_moment
75:     end
76:   end

Protected Instance methods

[Source]

    # File app/controllers/words_controller.rb, line 80
80:   def before_create_save(word)
81:     manage_vocabulary_lists(word)
82:   end

[Source]

    # File app/controllers/words_controller.rb, line 84
84:   def before_update_save(word)
85:     manage_vocabulary_lists(word)
86:   end

[Source]

     # File app/controllers/words_controller.rb, line 100
100:   def create_authorized?
101:     return is_authorized_as?(UserRole::USER_ROLE_ADMIN)
102:   end

[Source]

     # File app/controllers/words_controller.rb, line 104
104:   def delete_authorized?
105:     return is_authorized_as?(UserRole::USER_ROLE_ADMIN)
106:   end

[Source]

    # File app/controllers/words_controller.rb, line 92
92:   def read_authorized?
93:     return is_authorized_as?(UserRole::USER_ROLE_USER)
94:   end

[Source]

    # File app/controllers/words_controller.rb, line 88
88:   def search_authorized?
89:     return is_authorized_as?(UserRole::USER_ROLE_USER)
90:   end

[Source]

    # File app/controllers/words_controller.rb, line 96
96:   def update_authorized?
97:     return is_authorized_as?(UserRole::USER_ROLE_USER)
98:   end

[Validate]