This commit is contained in:
albert
2012-02-20 15:33:42 -05:00
parent 05924fc286
commit 393b071fa1
4 changed files with 20 additions and 0 deletions

View File

@@ -20,6 +20,10 @@ class UsersController < ApplicationController
respond_with(@users)
end
def search
@search = User.search(params[:search])
end
def show
@user = User.find(params[:id])
@presenter = UserPresenter.new(@user)

View File

@@ -1,6 +1,7 @@
<% content_for(:secondary_links) do %>
<menu>
<li><%= link_to "Listing", users_path %></li>
<li><%= link_to "Search", search_users_path %></li>
<% if CurrentUser.is_anonymous? %>
<li><%= link_to "Sign up", new_user_path %></li>
<% end %>

View File

@@ -0,0 +1,14 @@
<div id="c-users">
<div id="a-search">
<%= simple_form_for(@search) do |f| %>
<%= f.input :name_matches, :required => false, :label => "Name" %>
<%= f.button :submit, "Search" %>
<% end %>
</div>
</div>
<%= render "secondary_links" %>
<% content_for(:page_title) do %>
Search Users - <%= Danbooru.config.app_name %>
<% end %>

View File

@@ -158,6 +158,7 @@ Danbooru::Application.routes.draw do
resources :users do
collection do
get :upgrade_information
get :search
end
member do