Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --controller--
- class PostsController < ApplicationController
- def index
- @posts = Post.search(params[:query])
- end
- end
- --view--
- <% form_tag posts_path, :method => :get do %>
- <p>
- <%= text_field_tag "query", "", "size" => 30 %>
- </p>
- <p>
- <%= submit_tag "Search" %>
- </p>
- <% end %>
Add Comment
Please, Sign In to add comment