Commit 98a45ce6 authored by randx's avatar randx

admin area -> search for projecs

parent 77cf6620
......@@ -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
......
......@@ -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
......
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