On Wed, Feb 22, 2012 at 2:15 PM, Roger Patrick <li...@ruby-forum.com> wrote:
> > class SearchesController < ApplicationController > def new > @search = Search.new > end > > def create > @search = Search.new(params[:search]) > if @search.save > redirect_to @search, :notice => "Successfully created search." > else > render :action => 'new' > end > end > > def show > @search = Search.find(params[:id]) > end > end > If you see the log, the you'll see a query ( the result of Search.find(params[:id]), after that you haven't told rails what to do with it, so as you see on you create method you're being redirect to "@search" (that's a sort of abreviation of what you have on your routes.rb file) You may want to do a respond_to block, try searching that on rails guide or try this tutorial http://ruby.railstutorial.org/ Javier Q > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.