Class CharacterRadicalsController
In: app/controllers/character_radicals_controller.rb
Parent: ApplicationController

Methods

Public Instance methods

[Source]

    # File app/controllers/character_radicals_controller.rb, line 43
43:   def find_by_radicals
44:     render(:partial => 'character_radicals/filter_by_character_radicals')
45:   end

[Source]

    # File app/controllers/character_radicals_controller.rb, line 47
47:   def set_search
48:     save_setting_session_map(:character_radical_ids)
49:     redirect_to(:back)
50:   end

Protected Instance methods

[Source]

    # File app/controllers/character_radicals_controller.rb, line 54
54:   def conditions_for_collection
55:     query     = ''
56:     variables = Array.new
57:     
58:     # limit our characters that only include the specified radicals
59:     if session[:character_radical_ids] && (not session[:character_radical_ids].empty?)
60:       query_sub_strings = Array.new
61:       for radical_id in session[:character_radical_ids].keys
62:         query_sub_strings << ' character_radicals.radical_id = ? '
63:         variables         << [ radical_id.to_i ]
64:       end
65:       query << query_sub_strings.join(' OR ')
66:     end
67:  
68:     parameters = [query]
69:     variables.each{|variable| parameters << variable }
70:     return parameters
71:   end

[Source]

    # File app/controllers/character_radicals_controller.rb, line 85
85:   def create_authorized?
86:     return is_authorized_as?(UserRole::USER_ROLE_ADMIN)
87:   end

[Source]

    # File app/controllers/character_radicals_controller.rb, line 89
89:   def destroy_authorized?
90:     return is_authorized_as?(UserRole::USER_ROLE_ADMIN)
91:   end

[Source]

    # File app/controllers/character_radicals_controller.rb, line 77
77:   def read_authorized?
78:     return is_authorized_as?(UserRole::USER_ROLE_USER)
79:   end

[Source]

    # File app/controllers/character_radicals_controller.rb, line 73
73:   def search_authorized?
74:     return is_authorized_as?(UserRole::USER_ROLE_USER)
75:   end

[Source]

    # File app/controllers/character_radicals_controller.rb, line 81
81:   def update_authorized?
82:     return is_authorized_as?(UserRole::USER_ROLE_USER)
83:   end

[Validate]