ruby on rails 3 - Using link_to with routes -


my route:

  scope "/ajax"     resources :companies       resources :comments     end   end 

so, link_to company.title, company generates such url: /ajax/companies/1

how generate clear url without first /ajax/ part? result want generate companies/(:id) , companies/create , companies/edit/(:id)

the obvious answer remove scope '/ajax' do line, have feeling not looking for. maybe put resources line in there again outside of scope block.

is ajax module? if so, replace scope :module => 'ajax' do.


Comments

Popular posts from this blog

Javascript line number mapping -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -