diff options
author | randx <dmitriy.zaporozhets@gmail.com> | 2012-06-21 19:54:57 +0400 |
---|---|---|
committer | randx <dmitriy.zaporozhets@gmail.com> | 2012-06-21 19:54:57 +0400 |
commit | 98a45ce6ee50ced19a22e6a9153bb778de8fa001 (patch) | |
tree | 1860690a86f03fedf748150552dc0a9fc0aaf7f8 /app | |
parent | 77cf662034a7187fe7e223e6d16b664b7b525d25 (diff) |
admin area -> search for projecs
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/admin/projects_controller.rb | 4 | ||||
-rw-r--r-- | app/views/admin/projects/index.html.haml | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/app/controllers/admin/projects_controller.rb b/app/controllers/admin/projects_controller.rb index e4b97368fc5..5266b406504 100644 --- a/app/controllers/admin/projects_controller.rb +++ b/app/controllers/admin/projects_controller.rb @@ -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 diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml index e4f19e1ccc0..932fb37ddf6 100644 --- a/app/views/admin/projects/index.html.haml +++ b/app/views/admin/projects/index.html.haml @@ -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 |