# Couldn't find without an ID

**URL:** <https://www.ruby-forum.com/t/couldnt-find-without-an-id/163810>\
**Category:** Rails\
**Created:** [March 25, 2009, 3:42am UTC](https://www.ruby-forum.com/t/couldnt-find-without-an-id/163810 "2009-03-25T03:42:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ple\_mazako](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/5daacb/32.png) [@ple\_mazako](https://www.ruby-forum.com/u/ple_mazako)\
**Post date:** [March 25, 2009, 3:42am UTC](https://www.ruby-forum.com/t/couldnt-find-without-an-id/163810/1 "2009-03-25T03:42:05Z")

</div>

hello ,  
i have problem when i want to show page after user submit data into  
database.  
this is code in controller

> > >

class ComponentsController \< ApplicationController

def index  
end

def databases  
@title = “Database”  
if request.post?and params[:seq]  
params[:seq][:sequence].gsub!(/\s/,"")  
params[:seq][:sequence].upcase!  
@seq = Seq.new(params[:seq])  
if @seq.save  
flash[:notice] = “sequence submitted !”  
redirect\_to :action =\> “show”  
end  
end  
end

def show  
@title = “Show”  
@seq = Seq.find(params[:id])  
end  
end  
end

> > when i run i have error like is  
> > ActiveRecord::RecordNotFound in ComponentsController#show  
> > Couldn’t find Seq without an ID  
> > /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active\_record/  
> > base.rb:1572:in `find_from_ids' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/ base.rb:616:in`find’  
> > /home/apple/www/rcc\_eri/app/controllers/components\_controller.rb:29:in  
> > `show’

---

<div class="post-metadata">

**Author:** ![ple\_mazako](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/5daacb/32.png) [@ple\_mazako](https://www.ruby-forum.com/u/ple_mazako)\
**Post date:** [March 25, 2009, 4:27am UTC](https://www.ruby-forum.com/t/couldnt-find-without-an-id/163810/2 "2009-03-25T04:27:12Z")

</div>

it is not

> redirect\_to :action =\> “show”

BUT :  
redirect\_to :action =\> “show”, :id =\> @seq.id

Good Luck,  
Reinhart  
company : [be-barefoot.com](http://be-barefoot.com)

Thiti Panya wrote:

> hello ,  
> i have problem when i want to show page after user submit data into  
> database.  
> this is code in controller
> 
> > > >
> 
> class ComponentsController \< ApplicationController
> 
> def index  
> end
> 
> def databases  
> @title = “Database”  
> if request.post?and params[:seq]  
> params[:seq][:sequence].gsub!(/\s/,“”)  
> params[:seq][:sequence].upcase!  
> @seq = Seq.new(params[:seq])  
> if @seq.save  
> flash[:notice] = “sequence submitted !”  
> redirect\_to :action =\> “show”  
> end  
> end  
> end
> 
> def show  
> @title = “Show”  
> @seq = Seq.find(params[:id])  
> end  
> end  
> end
> 
> > > when i run i have error like is  
> > > ActiveRecord::RecordNotFound in ComponentsController#show  
> > > Couldn’t find Seq without an ID  
> > > /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active\_record/  
> > > base.rb:1572:in `find_from_ids' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/ base.rb:616:in `find’  
> > > /home/apple/www/rcc\_eri/app/controllers/components\_controller.rb:29:in  
> > > `show’

---

<div class="post-metadata">

**Author:** ![ple\_mazako](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/5daacb/32.png) [@ple\_mazako](https://www.ruby-forum.com/u/ple_mazako)\
**Post date:** [March 25, 2009, 4:44am UTC](https://www.ruby-forum.com/t/couldnt-find-without-an-id/163810/3 "2009-03-25T04:44:49Z")

</div>

thank you very much Reinhart  
it’ work. -\_\_\_-

2009/3/25 Rails T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
