admin area -> search for projecs
This commit is contained in:
parent
77cf662034
commit
98a45ce6ee
2 changed files with 7 additions and 1 deletions
|
@ -4,7 +4,9 @@ class Admin::ProjectsController < ApplicationController
|
||||||
before_filter :authenticate_admin!
|
before_filter :authenticate_admin!
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@admin_projects = Project.page(params[:page])
|
@admin_projects = Project.scoped
|
||||||
|
@admin_projects = @admin_projects.search(params[:name]) if params[:name].present?
|
||||||
|
@admin_projects = @admin_projects.page(params[:page])
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
|
|
@ -2,6 +2,10 @@
|
||||||
Projects
|
Projects
|
||||||
= link_to 'New Project', new_admin_project_path, :class => "btn small right"
|
= link_to 'New Project', new_admin_project_path, :class => "btn small right"
|
||||||
%br
|
%br
|
||||||
|
= form_tag admin_projects_path, :method => :get do
|
||||||
|
= text_field_tag :name, params[:name], :class => "xlarge"
|
||||||
|
= submit_tag "Search", :class => "btn submit primary"
|
||||||
|
|
||||||
%table.admin-table
|
%table.admin-table
|
||||||
%thead
|
%thead
|
||||||
%th Name
|
%th Name
|
||||||
|
|
Loading…
Reference in a new issue