admin area -> search for projecs

This commit is contained in:
randx 2012-06-21 18:54:57 +03:00
parent 77cf662034
commit 98a45ce6ee
2 changed files with 7 additions and 1 deletions

View file

@ -4,7 +4,9 @@ class Admin::ProjectsController < ApplicationController
before_filter :authenticate_admin!
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
def show

View file

@ -2,6 +2,10 @@
Projects
= link_to 'New Project', new_admin_project_path, :class => "btn small right"
%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
%thead
%th Name