Commit 98a45ce6 authored by randx's avatar randx

admin area -> search for projecs

parent 77cf6620
...@@ -4,7 +4,9 @@ class Admin::ProjectsController < ApplicationController ...@@ -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 @@ ...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment