# Problems while moving to a new-alike method

**URL:** <https://www.ruby-forum.com/t/problems-while-moving-to-a-new-alike-method/172633>\
**Category:** Rails\
**Created:** [July 24, 2009, 9:33am UTC](https://www.ruby-forum.com/t/problems-while-moving-to-a-new-alike-method/172633 "2009-07-24T09:33:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 24, 2009, 9:33am UTC](https://www.ruby-forum.com/t/problems-while-moving-to-a-new-alike-method/172633/1 "2009-07-24T09:33:37Z")

</div>

Hi,

I have a licenses controller. Other than a new method, i have a  
new\_trial\_license method.

## The link implementation for the new\_trial\_license method looks like:

\<%= link\_to ‘New Trial license’, :action =\> “new\_trial\_license” %\>

The link shows up as i expected  
[http://localhost:3000/licenses/new\_trial\_license](http://localhost:3000/licenses/new_trial_license)

## But it causes some error when i try to move to the page. The traceback is:

ActiveRecord::RecordNotFound in LicensesController#show

Couldn’t find License with ID=new\_trial\_license

RAILS\_ROOT: /home/vimal/Projects/license\_manager/  
Application Trace | Framework Trace | Full Trace

/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active\_record/  
base.rb:1528:in `find_one' /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ base.rb:1511:in `find\_from\_ids’  
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active\_record/  
base.rb:590:in `find' app/controllers/licenses_controller.rb:22:in `show’

Regards,  
Vimal Das

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 24, 2009, 9:59am UTC](https://www.ruby-forum.com/t/problems-while-moving-to-a-new-alike-method/172633/2 "2009-07-24T09:59:56Z")

</div>

On Jul 24, 8:32 am, vimal [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 

If you are useing restful routes (ie you have map.resources :licenses  
in routes.rb) then you need to add this new action to routes.rb (see  
map.resources’ :collection option)

Fred

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 24, 2009, 10:26am UTC](https://www.ruby-forum.com/t/problems-while-moving-to-a-new-alike-method/172633/3 "2009-07-24T10:26:49Z")

</div>

Thanks Fred 🙂

Regards,  
Vimal Das
