100+ results for 'ransack(params[:q])'
Not the results you expected?
orders_controller.rb (https://gitlab.com/shinvdu/spree) Ruby · 137 lines
53 def index
54 authorize! :index, Order
55 @orders = Order.ransack(params[:q]).result.page(params[:page]).per(params[:per_page])
56 respond_with(@orders)
57 end
88 def mine
89 if current_api_user.persisted?
90 @orders = current_api_user.orders.reverse_chronological.ransack(params[:q]).result.page(params[:page]).per(params[:per_page])
91 else
92 render "spree/api/errors/unauthorized", status: :unauthorized
users_controller.rb (https://github.com/fig/spree.git) Ruby · 109 lines
orders_controller.rb (https://github.com/Aeon/spree.git) Ruby · 125 lines
return_authorizations_controller.rb (https://gitlab.com/shinvdu/spree) Ruby · 71 lines
products_controller.rb (https://github.com/pdamer/spree-1.git) Ruby · 138 lines
orders_controller.rb (https://github.com/GeekOnCoffee/spree.git) Ruby · 149 lines
orders_controller.rb (https://github.com/fabien/spree.git) Ruby · 127 lines
users_controller.rb (https://gitlab.com/shinvdu/spree) Ruby · 145 lines
klasses_controller.rb (https://gitlab.com/cd2/developingexperts) Ruby · 87 lines
taxons_controller.rb (https://github.com/joshnuss/spree-1.git) Ruby · 76 lines
taxons_controller.rb (https://gitlab.com/shinvdu/spree) Ruby · 98 lines
10 @taxons = Spree::Taxon.includes(:children).accessible_by(current_ability, :read).where(id: params[:ids].split(','))
11 else
12 @taxons = Spree::Taxon.includes(:children).accessible_by(current_ability, :read).order(:taxonomy_id, :lft).ransack(params[:q]).result
13 end
14 end
69 # Products#index does not do the sorting.
70 taxon = Spree::Taxon.find(params[:id])
71 @products = taxon.products.ransack(params[:q]).result
72 @products = @products.page(params[:page]).per(params[:per_page] || 500)
73 render "spree/api/v1/products/index"
teachers_controller.rb (https://gitlab.com/cd2/developingexperts) Ruby · 71 lines
application_controller.rb (https://gitlab.com/cd2/cms) Ruby · 113 lines
search_controller.rb (https://gitlab.com/shinvdu/spree) Ruby · 50 lines
shipments_controller.rb (https://github.com/pdamer/spree-1.git) Ruby · 149 lines
products_controller.rb (https://github.com/paulcc/spree.git) Ruby · 144 lines
stock_items_controller.rb (https://gitlab.com/shinvdu/spree) Ruby · 77 lines
schedules_controller.rb (https://gitlab.com/mdrz_92/prestasala) Ruby · 101 lines
pupils_controller.rb (https://gitlab.com/cd2/developingexperts) Ruby · 104 lines
option_values_controller.rb (https://gitlab.com/shinvdu/spree) Ruby · 63 lines
reports_controller.rb (https://gitlab.com/shinvdu/spree) Ruby · 65 lines
orders_controller.rb (https://github.com/tomz/spree.git) Ruby · 137 lines
40 def index
41 authorize! :index, Order
42 @orders = Order.ransack(params[:q]).result.page(params[:page]).per(params[:per_page])
43 respond_with(@orders)
44 end
68 def mine
69 if current_api_user.persisted?
70 @orders = current_api_user.orders.ransack(params[:q]).result.page(params[:page]).per(params[:per_page])
71 else
72 render "spree/api/errors/unauthorized", status: :unauthorized
users_controller.rb (https://gitlab.com/shinvdu/spree) Ruby · 60 lines
return_authorizations_controller.rb (https://github.com/tomz/spree.git) Ruby · 78 lines
pictures_controller.rb (https://github.com/seaneshbaugh/portfolio.git) Ruby · 117 lines
pages_controller.rb (https://github.com/magiclabs/alchemy_cms.git) Ruby · 129 lines
links_controller.rb (https://github.com/seaneshbaugh/portfolio.git) Ruby · 85 lines
products_controller.rb (https://github.com/solidusio/solidus.git) Ruby · 137 lines
stock_items_controller.rb (https://github.com/joshnuss/spree-1.git) Ruby · 68 lines
pages_controller.rb (https://github.com/seaneshbaugh/portfolio.git) Ruby · 85 lines
promotions_controller.rb (https://gitlab.com/shinvdu/spree) Ruby · 36 lines
product_properties_controller.rb (https://gitlab.com/shinvdu/spree) Ruby · 73 lines
products_controller.rb (git://github.com/spree/spree.git) Ruby · 131 lines
products_controller.rb (https://github.com/crystalneth/spree.git) Ruby · 123 lines
stock_transfers_controller.rb (https://github.com/chienyuan/spree.git) Ruby · 53 lines
option_values_controller.rb (https://github.com/tomz/spree.git) Ruby · 58 lines
products_controller.rb (https://github.com/pageman/spree.git) Ruby · 56 lines
product_properties_controller.rb (git://github.com/spree/spree.git) Ruby · 73 lines
taxonomies_controller.rb (https://gitlab.com/adamlwalker/spree) Ruby · 66 lines
wholesalers_controller.rb (https://github.com/citrus/spree_wholesale.git) Ruby · 82 lines
taxons_controller.rb (https://github.com/tomz/spree.git) Ruby · 93 lines
9 @taxons = Spree::Taxon.accessible_by(current_ability, :read).where(id: params[:ids].split(','))
10 else
11 @taxons = Spree::Taxon.accessible_by(current_ability, :read).order(:taxonomy_id, :lft).ransack(params[:q]).result
12 end
13 end
65 # Products#index does not do the sorting.
66 taxon = Spree::Taxon.find(params[:id])
67 @products = taxon.products.ransack(params[:q]).result
68 @products = @products.page(params[:page]).per(500 || params[:per_page])
69 render "spree/api/products/index"
search_controller.rb (https://gitlab.com/adamlwalker/spree) Ruby · 41 lines
shipments_controller.rb (https://gitlab.com/shinvdu/spree) Ruby · 163 lines
resource_controller.rb (https://github.com/solidusio/solidus.git) Ruby · 87 lines
taxons_controller.rb (https://github.com/pageman/spree.git) Ruby · 78 lines
orders_controller.rb (https://github.com/fig/spree.git) Ruby · 155 lines
variants_controller.rb (https://github.com/pdamer/spree-1.git) Ruby · 73 lines
variants_controller.rb (https://github.com/joshnuss/spree-1.git) Ruby · 72 lines
products_controller.rb (https://github.com/chienyuan/spree.git) Ruby · 129 lines
products_controller.rb (https://github.com/jsqu99/spree.git) Ruby · 138 lines
stock_locations_controller.rb (https://gitlab.com/shinvdu/spree) Ruby · 52 lines
products_controller.rb (https://github.com/jmbejar/spree.git) Ruby · 115 lines
orders_controller.rb (https://github.com/jmbejar/spree.git) Ruby · 133 lines
orders_controller.rb (https://github.com/slavix/spree.git) Ruby · 131 lines
40 def index
41 authorize! :index, Order
42 @orders = Order.ransack(params[:q]).result.page(params[:page]).per(params[:per_page])
43 respond_with(@orders)
44 end
66 def mine
67 if current_api_user.persisted?
68 @orders = current_api_user.orders.reverse_chronological.ransack(params[:q]).result.page(params[:page]).per(params[:per_page])
69 else
70 render "spree/api/errors/unauthorized", status: :unauthorized
zones_controller.rb (https://gitlab.com/shinvdu/spree) Ruby · 51 lines
products_controller.rb (https://gitlab.com/shinvdu/spree) Ruby · 129 lines
states_controller.rb (https://gitlab.com/adamlwalker/spree) Ruby · 40 lines
promotions_controller.rb (https://github.com/fig/spree.git) Ruby · 37 lines
option_types_controller.rb (https://github.com/tomz/spree.git) Ruby · 49 lines
taxonomies_controller.rb (https://github.com/tomz/spree.git) Ruby · 64 lines
orders_controller.rb (https://gitlab.com/shinvdu/spree) Ruby · 149 lines
payments_controller.rb (https://gitlab.com/shinvdu/spree) Ruby · 82 lines
orders_controller.rb (https://github.com/eraserx99/spree.git) Ruby · 116 lines
stock_movements_controller.rb (https://gitlab.com/shinvdu/spree) Ruby · 45 lines
properties_controller.rb (https://github.com/joshnuss/spree-1.git) Ruby · 61 lines
zones_controller.rb (https://github.com/chienyuan/spree.git) Ruby · 46 lines
properties_controller.rb (https://gitlab.com/shinvdu/spree) Ruby · 72 lines
users_controller.rb (https://github.com/chienyuan/spree.git) Ruby · 53 lines
variants_controller.rb (https://github.com/solidusio/solidus.git) Ruby · 90 lines
payments_controller.rb (https://github.com/tomz/spree.git) Ruby · 94 lines
products_controller.rb (https://github.com/tomz/spree.git) Ruby · 126 lines
users_controller.rb (https://github.com/andrewmp1/spree.git) Ruby · 68 lines
enterprises_controller.rb (https://gitlab.com/srihas/openfoodnetwork) Ruby · 70 lines
states_controller.rb (https://github.com/joshnuss/spree-1.git) Ruby · 36 lines
orders_controller.rb (https://github.com/solidusio/solidus.git) Ruby · 190 lines
taxonomies_controller.rb (https://github.com/joshnuss/spree-1.git) Ruby · 58 lines
reports_controller.rb (https://github.com/joshnuss/spree-1.git) Ruby · 55 lines
variants_controller.rb (git://github.com/spree/spree.git) Ruby · 81 lines
return_authorizations_controller.rb (https://github.com/solidusio/solidus.git) Ruby · 81 lines
stock_locations_controller.rb (https://github.com/solidusio/solidus.git) Ruby · 60 lines
properties_controller.rb (https://github.com/tomz/spree.git) Ruby · 70 lines
users_controller.rb (https://github.com/paulcc/spree.git) Ruby · 166 lines
variants_controller.rb (https://github.com/tomz/spree.git) Ruby · 74 lines
taxons_controller.rb (git://github.com/spree/spree.git) Ruby · 95 lines
11 Spree::Taxon.includes(:children).accessible_by(current_ability).order(:taxonomy_id, :lft)
12 end
13 @taxons = @taxons.ransack(params[:q]).result
14 @taxons = @taxons.page(params[:page]).per(params[:per_page])
15 respond_with(@taxons)
66 # Products#index does not do the sorting.
67 taxon = Spree::Taxon.find(params[:id])
68 @products = taxon.products.ransack(params[:q]).result
69 @products = @products.page(params[:page]).per(params[:per_page] || 500)
70 render 'spree/api/v1/products/index'
taxons_controller.rb (https://github.com/solidusio/solidus.git) Ruby · 126 lines
10 @taxons = Spree::Taxon.accessible_by(current_ability).where(id: params[:ids].split(','))
11 else
12 @taxons = Spree::Taxon.accessible_by(current_ability).order(:taxonomy_id, :lft).ransack(params[:q]).result
13 end
74 # Products#index does not do the sorting.
75 taxon = Spree::Taxon.find(params[:id])
76 @products = paginate(taxon.products.ransack(params[:q]).result)
77 @products = @products.includes(master: :default_price)
stock_transfers_controller.rb (https://gitlab.com/shinvdu/spree) Ruby · 51 lines
images_controller.rb (https://gitlab.com/slice-group/speakers-web.git) Ruby · 91 lines
products_controller_decorator.rb (https://gitlab.com/srihas/openfoodnetwork) Ruby · 71 lines
6 authorize! :read, Spree::Product
8 @products = product_scope.ransack(params[:q]).result.managed_by(current_api_user).page(params[:page]).per(params[:per_page])
9 respond_with(@products, default_template: :index)
10 end
15 merge(product_scope).
16 order('created_at DESC').
17 ransack(params[:q]).result.
18 page(params[:page]).per(params[:per_page])
61 where(supplier_id: producers).
62 by_producer.by_name.
63 ransack(params[:q]).result.
64 page(params[:page]).per(params[:per_page])
65 end
option_types_controller.rb (https://gitlab.com/shinvdu/spree) Ruby · 54 lines
7 @option_types = Spree::OptionType.includes(:option_values).accessible_by(current_ability, :read).where(id: params[:ids].split(','))
8 else
9 @option_types = Spree::OptionType.includes(:option_values).accessible_by(current_ability, :read).load.ransack(params[:q]).result
10 end
11 respond_with(@option_types)
books_controller.rb (https://gitlab.com/igorduarte/Library.git) Ruby · 77 lines
chat_channels_controller.rb (https://github.com/thepracticaldev/dev.to.git) Ruby · 58 lines
products_controller.rb (https://github.com/liwei78/rails-practice-code.git) Ruby · 87 lines
stock_locations_controller.rb (https://github.com/tomz/spree.git) Ruby · 50 lines
users_controller.rb (https://github.com/fig/spree.git) Ruby · 67 lines
product_properties_controller.rb (https://github.com/tomz/spree.git) Ruby · 72 lines
users_controller.rb (https://github.com/brunofacca/zen-rails-base-app.git) Ruby · 97 lines
variants_controller.rb (https://gitlab.com/adamlwalker/spree) Ruby · 75 lines
orders_controller.rb (https://github.com/crystalneth/spree.git) Ruby · 89 lines
stock_movements_controller.rb (https://github.com/tomz/spree.git) Ruby · 43 lines
return_index_controller.rb (https://gitlab.com/shinvdu/spree) Ruby · 28 lines
20 @collection = resource.all
21 # @search needs to be defined as this is passed to search_form_for
22 @search = @collection.ransack(params[:q])
23 per_page = params[:per_page] || Spree::Config[:admin_products_per_page]
24 @collection = @search.result.order(created_at: :desc).page(params[:page]).per(per_page)