mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-01-23 16:57:54 -05:00
24 lines
549 B
Ruby
24 lines
549 B
Ruby
module Admin
|
|
class OrdersController < ApplicationController
|
|
def index
|
|
authorize! :manage, :all
|
|
respond_to do |format|
|
|
format.html # index.html.haml
|
|
end
|
|
end
|
|
|
|
def search
|
|
authorize! :manage, :all
|
|
@orders = Order.search(by: params[:search_by], for: params[:search_text])
|
|
|
|
if @orders.empty?
|
|
flash[:alert] = "Couldn't find order with #{params[:search_by]} = #{params[:search_text]}"
|
|
end
|
|
|
|
respond_to do |format|
|
|
format.html # index.html.haml
|
|
end
|
|
end
|
|
end
|
|
end
|