That part is obvious; it’s the standard behavior. I’m trying to get
something other than standard behaviour. What I’m asking is how do I
get it to search for a Record in the db with code = “honda”?
you will need to add ‘:conditions => [“code = ?”, params[:code] ]’ to
your finds.
Particularly the paginate function in the list action.
Thanks. This isn’t working.
Using this URL:
http://localhost:3000/makes/honda/
And this “show” in “makes_controller.rb”:
def show
@make = Make.find(params[:id], :conditions => [“code = ?”,
params[:code] ])
end
I get this error:
ActiveRecord::RecordNotFound in Makes#show
Couldn’t find Make without an ID AND (code = ‘1’)
Changing to:
def show
@make = Make.find(params[:code], :conditions => [“code = ?”,
params[:code] ])
end
I get this error:
ActiveRecord::RecordNotFound in Makes#show
Couldn’t find Make with ID=honda AND (code = ‘honda’)
Changing to:
def show
@make = Make.find(:all, :conditions => [“code = ?”, params[:code] ])
end
I get this error:
NoMethodError in Makes#show
Showing app/views/makes/show.rhtml where line #3 raised:
undefined method `Name’ for []:Array
Extracted source (around line #3):
1: <% for column in Make.content_columns %>
2:
3: <%= column.human_name %>: <%=h @make.send(column.name) %>
4:
5: <% end %>
6:
There are other problems no ones answered, but I can’t even get past
this. Help?
Thanks in advance.
-Mike
P.S. You can read all my questions here:
http://www.ruby-forum.com/topic/51328