I have been getting this error:
/home/shaili/project/app/models/inbox.rb:8: syntax error, unexpected end-of-input, expecting keyword_end
I am trying to add a search bar and have been also trying to set a path of the same page.
This is my models/inbox.rb file:
class Inbox < ActiveRecord::Base
def self.search(search)
if search
find(:all, :conditions => ['name LIKE ?', '%#{search}%'])
else
find(:all)
end
end
This is the part of my Inbox_controllers file:
@inbox = Inbox.search(params[:search])
This is the part of my inbox.html.erb file where I am trying to figure out the path of the same page:
<%= form_tag :method => 'get' do %>
<p>
<%= search_field_tag :Search, params[:search] %>
<%= submit_tag "Search", :name => nil %>
</p>
<% end %>