索引操作
@search = Project.search(params[:search])
@projects = @search.order('created_at desc').paginate(:page => params[:page], :per_page => 100)
@total_projects = Project.count
respond_to do |format|
format.html
format.mobile
format.json { render :json => @projects }
end
如果params[:search][:stage_in]
存在并且它等于“time_end”我想像这样更改它params[:search][:stage_in] == "started"
并且它可以与@search一起使用