Class: Decidim::FeedsUi::UsersController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Decidim::FeedsUi::UsersController
- Defined in:
- app/controllers/decidim/feeds_ui/users_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
Instance Method Details
#filter_users ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'app/controllers/decidim/feeds_ui/users_controller.rb', line 26 def filter_users # @user = Decidim::User.find_by(name: params[:name], interest: params[:interest], apartment: params[:apartment]) query = params[:name].downcase @users = confirmed_users.where("lower(name) LIKE ? OR lower(nickname) LIKE ?", "%#{query}%", "%#{query}%") respond_to do |format| format.js end end |
#index ⇒ Object
10 11 12 13 |
# File 'app/controllers/decidim/feeds_ui/users_controller.rb', line 10 def index :read, :users @users = confirmed_users end |
#profile_holder ⇒ Object
20 21 22 23 24 |
# File 'app/controllers/decidim/feeds_ui/users_controller.rb', line 20 def profile_holder return if params[:nickname].blank? @profile_holder ||= Decidim::UserBaseEntity.find_by("LOWER(nickname) = ? AND decidim_organization_id = ?", params[:nickname].downcase, current_organization.id) end |
#user_profile ⇒ Object
15 16 17 18 |
# File 'app/controllers/decidim/feeds_ui/users_controller.rb', line 15 def user_profile @user = confirmed_users.find(params[:id]) # Additional logic for displaying the user's profile end |