Problems while moving to a new-alike method

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

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:infind_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:inshow’

Regards,
Vimal Das

On Jul 24, 8:32 am, vimal [email protected] 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

Thanks Fred :slight_smile:

Regards,
Vimal Das

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs