[Rails] ROUTING ERROR" "No route matches [POST] "/signup - addendum to previous post

2016-07-21 Thread Howard Gilbert
Where I have said pressing "Signup" I should have said pressing "Signup" 
filling in the form and then pressing "Create my Account" 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/31281808-8ba5-4135-aa36-c5e402d24945%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Routing error

2016-05-12 Thread Emmanuel Abia
What routing error are you getting on the server?

On 12 May 2016 1:49 p.m., "Yuri Redaelli"  wrote:
>
> Hi all,
>
> for first sorry for my english.
>
> I've a Rails app with a namespaced route that works fine on localhost
> but does not work on remote Server.
>
> This is my error:
>
> ActionController::RoutingError (uninitialized constant
> Monitor::PapTagsController):
>
> My routes.rb
>
> namespace :monitor do
> resources :pap_tags do
>   resources :pap_tag_rules
> end
>   end
>
> file is: pap_tags_controller.rb
>
> class PapTagsController < ApplicationController
> ...
> end
>
> It's very strange, can you help me?
>
> thanks.
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to rubyonrails-talk+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/bb7068001ae39b25499e6845a1c6c8dd%40ruby-forum.com
.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAHewxcHj5nURovCa4Z56D%3DqFptjh_7ttZ3b4aheTOPj%3D08bQcg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Routing error

2016-05-12 Thread Yuri Redaelli
Hi all,

for first sorry for my english.

I've a Rails app with a namespaced route that works fine on localhost
but does not work on remote Server.

This is my error:

ActionController::RoutingError (uninitialized constant
Monitor::PapTagsController):

My routes.rb

namespace :monitor do
resources :pap_tags do
  resources :pap_tag_rules
end
  end

file is: pap_tags_controller.rb

class PapTagsController < ApplicationController
...
end

It's very strange, can you help me?

thanks.

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/bb7068001ae39b25499e6845a1c6c8dd%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Routing Error uninitialized constant TowcompaniesController

2016-02-27 Thread Walter Lee Davis
Yes, you have to have tow_companies, not towcompanies in the resources: line.

Read up on how Rails ties everything together with CamelCasing -> snake_casing 
conventions.

Walter

> On Feb 27, 2016, at 1:57 PM, Charles Hoff  wrote:
> 
> Tried restarting it, same thing, also tried the two things you mentioned 
> and get the same result. No idea why.
> 
> I posted the controller above like you requested, does it matter that 
> the actual controller file name is "tow_companies_controller.rb"? NOt 
> sure if the underscores affect anything.
> 
> 
> Any other ideas???
> 
> I appreciate your help!
> 
> 
> 
> Johnny Hu wrote in post #1181706:
>> Secondarily, did you have a web server running already? If so, maybe try
>> restarting it?
> 
> -- 
> Posted via http://www.ruby-forum.com/.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to rubyonrails-talk+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rubyonrails-talk/4faa530cb552d1931b0e78b7273fca0b%40ruby-forum.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/6370B507-3174-4249-A723-68AC560C1B70%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Routing Error uninitialized constant TowcompaniesController

2016-02-27 Thread Walter Lee Davis
Sorry, autocorrect fail. The thing missing in yours was the to: key, not the 
value. Just add the to: part to what you had.

Walter

> On Feb 27, 2016, at 1:18 PM, Charles Hoff  wrote:
> 
> Appreciate your help,
> 
> root to: 'towcompanies#index'
> 
> (Still generates the same error)
> 
> root to: 'tow companies#index'
> 
> ('tow companies' is not a supported controller name. )
> 
> 
> Anything else I could be missing?
> 
> -- 
> Posted via http://www.ruby-forum.com/.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to rubyonrails-talk+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rubyonrails-talk/564328c3590d3bf890d57b56793f1109%40ruby-forum.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/A12CEE99-E98B-4BE8-A1E8-55E252AD4121%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Routing Error uninitialized constant TowcompaniesController

2016-02-27 Thread Walter Lee Davis

> On Feb 27, 2016, at 12:55 PM, Charles Hoff  wrote:
> 
> Hi, Im really new to rails and I am getting the error in the subject. I
> have followed the steps in a tutorial and I still get this error, not
> really sure why.
> 
> My routes file is:
> 
> Rails.application.routes.draw do
>  resources :towcompanies
>  root 'towcompanies#index'

make this read:

root to: 'tow companies#index'

and then it will work.

Walter

> end
> 
> Any input would be appreciated.
> 
> 
> Thanks !
> 
> -- 
> Posted via http://www.ruby-forum.com/.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to rubyonrails-talk+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rubyonrails-talk/2cf3a2eac3bc92a09bb0a91bf399583c%40ruby-forum.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/48E6C558-9EF8-47BC-93FE-6C22FFCEE445%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Routing Error uninitialized constant TowcompaniesController

2016-02-27 Thread Charles Hoff
Hi, Im really new to rails and I am getting the error in the subject. I
have followed the steps in a tutorial and I still get this error, not
really sure why.

My routes file is:

Rails.application.routes.draw do
  resources :towcompanies
  root 'towcompanies#index'
end

Any input would be appreciated.


Thanks !

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/2cf3a2eac3bc92a09bb0a91bf399583c%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] rails routing error

2015-12-27 Thread Przemek Kosakowski
Hello,

Can you show us your routing file ?
W dniu pon., 28.12.2015 o 05:12 fugee ohu  napisał(a):

> clicking this link in the view
> <%= link_to 'Profile', new_user_profile_path(@user) %>
> causes
> NoMethodError in Profiles#new undefined method `profiles_path'
> here's the route from rake routes
> new_user_profile GET
> /users/:user_id/profile/new(.:format)
> profiles#new
>
> i'm using devise so i think current_user is the same as @user but i tried
> that too and it causes the same error
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-talk+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/f9e8207f-998d-4535-b402-db9055f5dd9b%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Pozdrawiam,
Przemek Kosakowski
tel: +48 743 868 900

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CACjdbWeJq%3D62XJeoAzSqsygfU3XRqUew76z05MbW-UZurCFyYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] rails routing error

2015-12-27 Thread fugee ohu
On Sunday, December 27, 2015 at 11:17:20 PM UTC-5, Przemek Kosakowski wrote:
>
> Hello, 
>
> Can you show us your routing file ?
>

 I got it solved i had declared profiles as a nested resource under users, 
but i still needed to declare it again, standalone
resources :profiles ~ thanks

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/988ad077-1b50-41d0-82f1-dd97f3967cab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] rails routing error

2015-12-27 Thread fugee ohu
clicking this link in the view
<%= link_to 'Profile', new_user_profile_path(@user) %>
causes
NoMethodError in Profiles#new undefined method `profiles_path' 
here's the route from rake routes
new_user_profile GET
/users/:user_id/profile/new(.:format)   
profiles#new

i'm using devise so i think current_user is the same as @user but i tried 
that too and it causes the same error


-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/f9e8207f-998d-4535-b402-db9055f5dd9b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Routing Error

2015-07-13 Thread karthik sharma


I am new to ruby on rails, by seeing tutorials i created blog, some 
complications are there but manged to get the home page and implemented 
bootstrap in that

Now i have created project in rails but unable to get the path from public 
folder in that application

the path goes like this 

~/workspace/ruby/blog - for blog 

~/workspace/ruby//cool_site - for new sample project 


--the error goes like this Routing Error No route matches [GET] 
/cool_site Rails.root: /home/ubuntu/workspace/ruby/blog

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/236d803e-c573-47f7-86c0-f5dcd7bbe775%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Routing Error

2015-07-13 Thread Colin Law
On 13 July 2015 at 15:01, karthik sharma acheiver...@gmail.com wrote:
 I am new to ruby on rails, by seeing tutorials i created blog, some
 complications are there but manged to get the home page and implemented
 bootstrap in that

 Now i have created project in rails but unable to get the path from public
 folder in that application

 the path goes like this

 ~/workspace/ruby/blog - for blog

 ~/workspace/ruby//cool_site - for new sample project


 --the error goes like this Routing Error No route matches [GET]
 /cool_site Rails.root: /home/ubuntu/workspace/ruby/blog

It seems you have still got the server running in the blog
application.  Close that server and start it in the new application
directory using
cd ~/workspace/ruby/cool_site
rails s
Then the cool_site will be accessible as localhost:3000.

Colin

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLs%2BvBpzyNFX9GX5aK_q%3D-2TXEoNs5HUL-86h4yyZqk5hA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Routing error in ajax on ruby on rails

2013-10-02 Thread Jose Urquidi
I have this in my .html.erb code:

 $.ajax({
 url: /timeMachineEdit,
 data: {editTimeMachine: newArray},
 type: 'POST',
 success: function (res) {
 if (res.result === 'ok') {
 alert('Data saved');
 } else {
 alert('Save error');
 }
},
error: function () {
 alert('Save error.');
 }
});


This in my datasets_controller.rb

def timeMachineEdit
@dataset = current_user.dataset
@dataset.machine_time = params[:editTimeMachine]
end


And in my routes.rb:

match /timeMachineEdit, to: datasets#timeMachineEdit


But when is submited shows:

POST http://localhost:3000/timeMachineEdit 500 (Internal Server Error)


Where is the problem here? is the routes in the ajax url or something
else?

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/60b0d276ee2f26610be70a31ac003c96%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Rails] Routing error in ajax on ruby on rails

2013-10-02 Thread Colin Law
On 2 October 2013 20:29, Jose Urquidi li...@ruby-forum.com wrote:
 I have this in my .html.erb code:

  $.ajax({
  url: /timeMachineEdit,
  data: {editTimeMachine: newArray},
  type: 'POST',
  success: function (res) {
  if (res.result === 'ok') {
  alert('Data saved');
  } else {
  alert('Save error');
  }
 },
 error: function () {
  alert('Save error.');
  }
 });


 This in my datasets_controller.rb

 def timeMachineEdit
 @dataset = current_user.dataset
 @dataset.machine_time = params[:editTimeMachine]
 end


 And in my routes.rb:

 match /timeMachineEdit, to: datasets#timeMachineEdit


 But when is submited shows:

 POST http://localhost:3000/timeMachineEdit 500 (Internal Server Error)


 Where is the problem here? is the routes in the ajax url or something
 else?

rake routes will show you the routes that are valid.  If you try that
I expect you will see that timeMachineEdit is only routed for GET.
You need to specify specifically if you want it to be valid for POST.
See the Rails Guide on Routing for more information.

Colin

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLvBTv3D9DDKF685aOKqN71%2B8%2BoH0D1XKj1yWozDRdXBVQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Rails] Routing error

2013-07-22 Thread trekr67
Hi,

I'm a newbie Ruby on Rails developer and have across the following problem:

I've put an image on a page and want to be taken to twitter to be 
authenticated, when the image is clicked however I get the following error 
when I do:

ActionController::Routing error (No route matches [GET] auth/twitter

I've registered my app on the Twitter dev site and have installed Ominiauth 
and Omniauth-Twitter gems. I've also added my Consumer keys and Consumer 
secret keys (for Twitter) to the relevant files.

This is the code around my image:-

=link_to image_tag(twitter.png, :size = 32x32), auth/twitter, :id = 
'twitter image'

Can anyone help please as I'm pulling my hair out in frustration!


-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/5b41e5e5-fac1-4e53-9d9d-f3e5d87bc9ae%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Routing error

2013-07-22 Thread Tamara Temple

On Jul 21, 2013, at 6:06 AM, trekr67 cebi...@gmail.com wrote:

 Hi,
 
 I'm a newbie Ruby on Rails developer and have across the following problem:
 
 I've put an image on a page and want to be taken to twitter to be 
 authenticated, when the image is clicked however I get the following error 
 when I do:
 
 ActionController::Routing error (No route matches [GET] auth/twitter
 
 I've registered my app on the Twitter dev site and have installed Ominiauth 
 and Omniauth-Twitter gems. I've also added my Consumer keys and Consumer 
 secret keys (for Twitter) to the relevant files.
 
 This is the code around my image:-
 
 =link_to image_tag(twitter.png, :size = 32x32), auth/twitter, :id = 
 'twitter image'
 
 Can anyone help please as I'm pulling my hair out in frustration!

First thing you should do is run:

$ rake routes

and see if there is a route for auth/twitter.

If there is not, add one in config/routes.rb for that route.

Read http://guides.rubyonrails.org/routing.html thoroughly.

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/E5C8446E-8877-4D92-A670-F2424C6E3C32%40gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Routing error when creating a new application

2013-05-31 Thread Cameron D.
Hello.

So I created a new application (named guestbook), controllers, and
entry(named sign_in) in Rails.  I uncommented the match
':controller..' and the 'root :to = 'welcome#index' lines in
config/locales/routes.rb file.  When I type
localhost:3000/entries/sign_in, I received the Routing Error, No
route matches [GET] /entries/sign_in

When running rake routes:  entries_sign_in GET
/entries/sign_in(.:format)entries#sign_in  root/welcome#index
/:controller(/:action(/:id)(.:format)   :controller#:action

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/abad3b9784f8540c9b21b0ebdb7bee92%40ruby-forum.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Routing error when creating a new application

2013-05-31 Thread Colin Law
On 31 May 2013 16:09, Cameron D. li...@ruby-forum.com wrote:
 Hello.

 So I created a new application (named guestbook), controllers, and
 entry(named sign_in) in Rails.  I uncommented the match
 ':controller..' and the 'root :to = 'welcome#index' lines in
 config/locales/routes.rb file.  When I type
 localhost:3000/entries/sign_in, I received the Routing Error, No
 route matches [GET] /entries/sign_in

 When running rake routes:  entries_sign_in GET
 /entries/sign_in(.:format)entries#sign_in  root/welcome#index
 /:controller(/:action(/:id)(.:format)   :controller#:action

Did you restart the server after changing routes.rb?  This is one of
the few occasions when a restart is necessary.

Colin

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtbi00f%3D3K6ro%3DHp0s4Fz0Z%2BQ%3D%2B%2BVPundBuqmgvHXrmGg%40mail.gmail.com?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Routing error in rails

2012-10-26 Thread ruby rails
In my controller I have

  def update_project_dates
   p It is end date.
  @user=User.find(params[:user])
   @projects=Project.find_all_by_user_id(@user)

   end

In the view page (only some part of the code is copied and pasted)

 eventDrop: function()
 {
   $.ajax({
 url:'/update_project_dates/',
 success:function(data)
 {
 alert(Hello);
 }
   })
 },

In my routes.rb I have mentioned

 match
 '/update_project_dates'='users#update_project_dates',:method=:get
 get 'update_project_dates'


But When the ajax request goes, I get the routing error as
h1Routing Error/h1
ppreuninitialized constant UsersController/pre/p

Where am I doing wrong here...Please help..

-- 
Posted via http://www.ruby-forum.com/.

-- 
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 https://groups.google.com/groups/opt_out.




[Rails] “Routing Error No route matches {}” when omniauth failed on registration

2012-09-16 Thread Iakiv Kramarenko
(Original question was asked here:
http://stackoverflow.com/questions/11506734/routing-error-no-route-matches-when-omniauth-failed-on-registration)

I am using omniauth-identity and configure its fail on registration.

My files:

config/initializers/omniauth.rb

OmniAuth.config.logger = Rails.logger

Rails.application.config.middleware.use OmniAuth::Builder do
  #...
  provider :identity, on_failed_registration: lambda { |env|
IdentitiesController.action(:new).call(env)
  }
end
config/routes.rb

Wie::Application.routes.draw do
  root to: 'categories#index'

  ActiveAdmin.routes(self)
  devise_for :admin_users, ActiveAdmin::Devise.config

  match 'auth/:provider/callback', to: 'sessions#create'
  match 'auth/failure', to: 'sessions#failure'
  match 'signout', to: 'sessions#destroy', as: 'signout'
  resources :identities#, only: [:new]
  resources :categories, path: '', only: [:index] do
resources :entries, path: '', only: [:index, :show]
  end
end
app/controllers/identities_controller.rb

class IdentitiesController  ApplicationController
  def new
ariane.add New Account

@identity = env['omniauth.identity']
  end
end
When I have a failure on registration (passing incorrect mail), I get
the following:

in browser:

Routing Error

No route matches {} Try running rake routes for more information on
available routes.

in server log:

Started POST /auth/identity/register for 127.0.0.1 at 2012-07-16
17:35:48 +0300 (0.1ms) begin transaction Identity Exists (0.2ms) SELECT
1 AS one FROM identities WHERE identities.email = 'foo' LIMIT 1
(0.1ms) rollback transaction Processing by IdentitiesController#new as
HTML Parameters: {utf8=✓, authenticity_token=HIDDEN :)=,
name=, email=foo, password=[FILTERED],
password_confirmation=[FILTERED], commit=Register}
Rendered identities/new.html.erb within layouts/application (11.2ms)
Completed 500 Internal Server Error in 44ms

ActionController::RoutingError (No route matches {}):
app/views/layouts/application.html.erb:35:in
_app_views_layouts_application_html_erb___1224394470845933684_70120630781720'
config/initializers/omniauth.rb:8:incall'
config/initializers/omniauth.rb:8:in `block (2 levels) in '

Rendered
/Users/ayia/.rvm/gems/ruby-1.9.3-p125@global/gems/actionpack-3.2.6/lib/action_dispatch/middleware/templates/rescues/routing_error.erb
within rescues/layout (0.6ms)

What can be the reason for this? What did I wrong?

-- 
Posted via http://www.ruby-forum.com/.

-- 
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 https://groups.google.com/groups/opt_out.




[Rails] “Routing Error No route matches {}” when omniauth failed on registration

2012-09-16 Thread Iakiv Kramarenko


(Original question was asked here: 
http://stackoverflow.com/questions/11506734/routing-error-no-route-matches-when-omniauth-failed-on-registration
)

I am using omniauth-identity and configure its fail on registration.

My files:

config/initializers/omniauth.rb

OmniAuth.config.logger = Rails.logger

Rails.application.config.middleware.use OmniAuth::Builder do
  #...
  provider :identity, on_failed_registration: lambda { |env|
IdentitiesController.action(:new).call(env)
  }
end

config/routes.rb

Wie::Application.routes.draw do
  root to: 'categories#index'

  ActiveAdmin.routes(self)
  devise_for :admin_users, ActiveAdmin::Devise.config

  match 'auth/:provider/callback', to: 'sessions#create'
  match 'auth/failure', to: 'sessions#failure'
  match 'signout', to: 'sessions#destroy', as: 'signout'
  resources :identities#, only: [:new]
  resources :categories, path: '', only: [:index] do
resources :entries, path: '', only: [:index, :show]
  end
end

app/controllers/identities_controller.rb

class IdentitiesController  ApplicationController
  def new
ariane.add New Account

@identity = env['omniauth.identity']
  end
end

*When I have a failure on registration (passing incorrect mail), I get the 
following:*

in browser:

Routing Error

No route matches {} Try running rake routes for more information on 
available routes.

in server log:

Started POST /auth/identity/register for 127.0.0.1 at 2012-07-16 17:35:48 
+0300 (0.1ms) begin transaction Identity Exists (0.2ms) SELECT 1 AS one 
FROM identities WHERE identities.email = 'foo' LIMIT 1 (0.1ms) 
rollback transaction Processing by IdentitiesController#new as HTML 
Parameters: {utf8=✓, authenticity_token=HIDDEN :)=, name=, 
email=foo, password=[FILTERED], 
password_confirmation=[FILTERED], commit=Register}
Rendered identities/new.html.erb within layouts/application (11.2ms) 
Completed 500 Internal Server Error in 44ms

ActionController::RoutingError (No route matches {}):
app/views/layouts/application.html.erb:35:in_app_views_layouts_application_html_erb___1224394470845933684_70120630781720'
 
config/initializers/omniauth.rb:8:incall'
config/initializers/omniauth.rb:8:in `block (2 levels) in '

Rendered 
/Users/ayia/.rvm/gems/ruby-1.9.3-p125@global/gems/actionpack-3.2.6/lib/action_dispatch/middleware/templates/rescues/routing_error.erb
 
within rescues/layout (0.6ms)

*What can be the reason for this? What did I wrong?*

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/Kq8Fm7O8oQsJ.
For more options, visit https://groups.google.com/groups/opt_out.




[Rails] Routing error.

2012-09-14 Thread Mukesh yadav
Hi all,
In my Rails app there is a code in which I have passed the two object to 
the nested url like this
  u_w_path(u, v)

Now the thing is, It is working fine before but suddenly I am getting a 
routing error because of the object u cannot be converted to 
id(automatically).

It says No route matches {:action=show, :controller=v, 
:id=#U:0xaf1f734 ..}
I have no idea what went wrong with the apps. Please suggest me solutions.

Regards,
Mukesh 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/2kJYYlrVDAEJ.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Rails] Routing error.

2012-09-14 Thread Colin Law
On 14 September 2012 15:00, Mukesh yadav ashu.33...@gmail.com wrote:
 Hi all,
 In my Rails app there is a code in which I have passed the two object to the
 nested url like this
   u_w_path(u, v)

 Now the thing is, It is working fine before but suddenly I am getting a
 routing error because of the object u cannot be converted to
 id(automatically).

 It says No route matches {:action=show, :controller=v,
 :id=#U:0xaf1f734 ..}
 I have no idea what went wrong with the apps. Please suggest me solutions.

Have you got u and v the right way round in the call?

Do lines of code that used to work no longer work or is it just new
lines of code that fail?

If lines of code that used to work no longer work then roll back in
your source control system (git or whatever) till you get to a point
where they work and then see what you changed to make it fail.

If you still can't get it working post the code that is failing, the
full error message, routes.rb, and the result of running rake routes.

Colin

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Rails] Routing error.

2012-09-14 Thread Mukesh yadav
Hi Colin,

I did it(roll back to last working commit) but the problem still persisted.
No clue why it is behaving like this.

Regards,
Mukesh


On Fri, Sep 14, 2012 at 8:23 PM, Colin Law clan...@googlemail.com wrote:

 On 14 September 2012 15:00, Mukesh yadav ashu.33...@gmail.com wrote:
  Hi all,
  In my Rails app there is a code in which I have passed the two object to
 the
  nested url like this
u_w_path(u, v)
 
  Now the thing is, It is working fine before but suddenly I am getting a
  routing error because of the object u cannot be converted to
  id(automatically).
 
  It says No route matches {:action=show, :controller=v,
  :id=#U:0xaf1f734 ..}
  I have no idea what went wrong with the apps. Please suggest me
 solutions.

 Have you got u and v the right way round in the call?

 Do lines of code that used to work no longer work or is it just new
 lines of code that fail?

 If lines of code that used to work no longer work then roll back in
 your source control system (git or whatever) till you get to a point
 where they work and then see what you changed to make it fail.

 If you still can't get it working post the code that is failing, the
 full error message, routes.rb, and the result of running rake routes.

 Colin

 --
 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 https://groups.google.com/groups/opt_out.




-- 
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 https://groups.google.com/groups/opt_out.




Re: [Rails] Routing error.

2012-09-14 Thread Colin Law
On 14 September 2012 16:07, Mukesh yadav ashu.33...@gmail.com wrote:

 Hi Colin,

Please don't top post it makes it more difficult to follow the thread,
and makes it easy to forget to answer questions - see below.


 I did it(roll back to last working commit) but the problem still persisted.
 No clue why it is behaving like this.

Did you restart the server after rolling back?  You need to restart
for routes.rb to be picked up.
Also see further points below.


 Regards,
 Mukesh


 On Fri, Sep 14, 2012 at 8:23 PM, Colin Law clan...@googlemail.com wrote:

 On 14 September 2012 15:00, Mukesh yadav ashu.33...@gmail.com wrote:
  Hi all,
  In my Rails app there is a code in which I have passed the two object to
  the
  nested url like this
u_w_path(u, v)
 
  Now the thing is, It is working fine before but suddenly I am getting a
  routing error because of the object u cannot be converted to
  id(automatically).
 
  It says No route matches {:action=show, :controller=v,
  :id=#U:0xaf1f734 ..}
  I have no idea what went wrong with the apps. Please suggest me
  solutions.

 Have you got u and v the right way round in the call?

You did not answer this question.


 Do lines of code that used to work no longer work or is it just new
 lines of code that fail?

 If lines of code that used to work no longer work then roll back in
 your source control system (git or whatever) till you get to a point
 where they work and then see what you changed to make it fail.

 If you still can't get it working post the code that is failing, the
 full error message, routes.rb, and the result of running rake routes.

You have not done this.

Colin

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Rails] Routing error.

2012-09-14 Thread Mukesh yadav
On Fri, Sep 14, 2012 at 8:55 PM, Colin Law clan...@googlemail.com wrote:

 On 14 September 2012 16:07, Mukesh yadav ashu.33...@gmail.com wrote:
 
  Hi Colin,

 Please don't top post it makes it more difficult to follow the thread,
 and makes it easy to forget to answer questions - see below.

 
  I did it(roll back to last working commit) but the problem still
 persisted.
  No clue why it is behaving like this.

 Did you restart the server after rolling back?  You need to restart
 for routes.rb to be picked up.
 Also see further points below.



  yes I restart the server .




 Regards,
 Mukesh


 On Fri, Sep 14, 2012 at 8:23 PM, Colin Law clan...@googlemail.com wrote:

 On 14 September 2012 15:00, Mukesh yadav ashu.33...@gmail.com wrote:
  Hi all,
  In my Rails app there is a code in which I have passed the two object
to
  the
  nested url like this
u_w_path(u, v)
 
  Now the thing is, It is working fine before but suddenly I am getting a
  routing error because of the object u cannot be converted to
  id(automatically).
 
  It says No route matches {:action=show, :controller=v,
  :id=#U:0xaf1f734 ..}
  I have no idea what went wrong with the apps. Please suggest me
  solutions.

 Have you got u and v the right way round in the call?

You did not answer this question.

yes the code is fine.


 Do lines of code that used to work no longer work or is it just new
 lines of code that fail?

 If lines of code that used to work no longer work then roll back in
 your source control system (git or whatever) till you get to a point
 where they work and then see what you changed to make it fail.

 If you still can't get it working post the code that is failing, the
 full error message, routes.rb, and the result of running rake routes.

You have not done this.

Ok I got another machine I cloned the code and start the server it is
working in different machine
but not on my machine any idea.
I think may be rails i18n or rails procedure to convert object to id in url
got unstructured any how.
any idea? or something else.

Colin

--
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 https://groups.google.com/groups/opt_out.

-- 
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 https://groups.google.com/groups/opt_out.




Re: [Rails] Routing error for stylesheets in rails 3.0

2012-07-05 Thread CavalryJim
Do you have a ss.css file in your public/stylesheets folder?  If not, that is 
the problem. 

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/y8NX41ck1P4J.
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-US.



Re: [Rails] Routing error for stylesheets in rails 3.0

2012-07-05 Thread Shalini Sah
Hi,

It was some mistake on my part. I have resolved it.

Thanks  Regards.

On Thu, Jul 5, 2012 at 6:37 PM, CavalryJim james.davis...@gmail.com wrote:

 Do you have a ss.css file in your public/stylesheets folder?  If not, that
 is the problem.

 --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/rubyonrails-talk/-/y8NX41ck1P4J.
 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-US.



-- 
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-US.



[Rails] Routing error for stylesheets in rails 3.0

2012-07-04 Thread Shalini Sah
Hi,

I added a css file in public/stylesheets folder (I use Rails 3.0 so no 
asset pipeline) and included it in my views by 

%= stylesheet_link_tag 'ss', :media = :all %

But I get a routing error on loading my page in my logs.

ActionController::RoutingError (No route matches /stylesheets/ss.css

Please tell me what are the required settings I maybe missing.

-- 
You received this message because you are subscribed to the Google Groups Ruby 
on Rails: Talk group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/E6Ixg7LnkaoJ.
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-US.



Re: [Rails] Routing error for stylesheets in rails 3.0

2012-07-04 Thread Colin Law
On 4 July 2012 14:12, Shalini Sah shalinisah6...@gmail.com wrote:
 Hi,

 I added a css file in public/stylesheets folder (I use Rails 3.0 so no asset
 pipeline) and included it in my views by

And the name of that file is?

Colin


 %= stylesheet_link_tag 'ss', :media = :all %

 But I get a routing error on loading my page in my logs.

 ActionController::RoutingError (No route matches /stylesheets/ss.css

 Please tell me what are the required settings I maybe missing.

 --
 You received this message because you are subscribed to the Google Groups
 Ruby on Rails: Talk group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/rubyonrails-talk/-/E6Ixg7LnkaoJ.
 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-US.

-- 
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-US.



Re: [Rails] Routing error for stylesheets in rails 3.0

2012-07-04 Thread Shalini Sah
ss.css

On Wed, Jul 4, 2012 at 6:51 PM, Colin Law clan...@googlemail.com wrote:

 On 4 July 2012 14:12, Shalini Sah shalinisah6...@gmail.com wrote:
  Hi,
 
  I added a css file in public/stylesheets folder (I use Rails 3.0 so no
 asset
  pipeline) and included it in my views by

 And the name of that file is?

 Colin

 
  %= stylesheet_link_tag 'ss', :media = :all %
 
  But I get a routing error on loading my page in my logs.
 
  ActionController::RoutingError (No route matches /stylesheets/ss.css
 
  Please tell me what are the required settings I maybe missing.
 
  --
  You received this message because you are subscribed to the Google Groups
  Ruby on Rails: Talk group.
  To view this discussion on the web visit
  https://groups.google.com/d/msg/rubyonrails-talk/-/E6Ixg7LnkaoJ.
  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-US.

 --
 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-US.



-- 
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-US.



[Rails] Routing error: no route matches contoller works. Route exists though

2012-06-05 Thread Martyn W.
I have a fairly straight forward rails app, version 3.2. When I try to
create a Work instance, with deliberately invalid fields from a form, I
get a routing error:

No route matches {:controller=works}

This does not happen when I try the same test with an update on a Work
instance. After an attempted update I get the edit.html.erb page
rendered with the invalid fields highlighted.

I dont understand why after failing the save in the controller and
trying to render new it would give me a route matching error. Any
ideas?

Attached are my model, controller and routes.rb

Attachments:
http://www.ruby-forum.com/attachment/7456/routes.rb
http://www.ruby-forum.com/attachment/7457/work.rb
http://www.ruby-forum.com/attachment/7458/works_controller.rb


-- 
Posted via http://www.ruby-forum.com/.

-- 
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.



Re: [Rails] Routing error: no route matches contoller works. Route exists though

2012-06-05 Thread Hassan Schroeder
On Tue, Jun 5, 2012 at 9:56 AM, Martyn W. li...@ruby-forum.com wrote:

 I dont understand why after failing the save in the controller and
 trying to render new it would give me a route matching error. Any
 ideas?

Yes - look at the log for that request :-)

-- 
Hassan Schroeder  hassan.schroe...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

-- 
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.



[Rails] routing error in partial when rendered from another controller

2012-03-19 Thread Erwin
in my routes.rb  I have  a route

resources :projects  do
  member do
 put change_photo
  end
end

 checked with rake routes CONTROLLER=projects
   change_photo_project PUT   /projects/:id/change_photo(.:format) 
 projects#change_photo

from my  projects#show  I render a partial with a form in it
def show
@project = Project.find(params[:id])
..
end

VIEWS
projects/show.html.haml
.span4= render :partial = projects/right_show

projects/_right_show.html.haml
..
 = form_for @project, :url = change_photo_project_path, :html =
{ :multipart = true , :method = :put} do |f|
 = f.file_field :photo
   = f.submit t(:update)

this is working fine

Now I am trying to display the same partial from another controller ,
orders#new

orders_controller.rb
  def new
@project = Project.find(params[:project_id])
  end

VIEWS
orders/new.html.haml
.span4= render :partial = projects/right_show

but then I get a routing error
No route matches {:action=change_photo, :controller=projects}
Try running rake routes for more information on available routes

I tried to pass the @project object
= render :partial = projects/right_show, :object = @project

but no way ,   Routing Error ..
and the rake routes doesn't show me anything wrong or missing ...

where am I wrong ?

-- 
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.



Re: [Rails] routing error in partial when rendered from another controller

2012-03-19 Thread Colin Law
On 19 March 2012 16:12, Erwin yves_duf...@mac.com wrote:
 in my routes.rb  I have  a route

 resources :projects  do
  member do
     put change_photo
  end
 end

  checked with rake routes CONTROLLER=projects
   change_photo_project PUT   /projects/:id/change_photo(.:format)         
 projects#change_photo

 from my  projects#show  I render a partial with a form in it
 def show
    @project = Project.find(params[:id])
 ..
 end

 VIEWS
 projects/show.html.haml
        .span4= render :partial = projects/right_show

 projects/_right_show.html.haml
 ..
     = form_for @project, :url = change_photo_project_path, :html =
 { :multipart = true , :method = :put} do |f|
         = f.file_field :photo
       = f.submit t(:update)

 this is working fine

 Now I am trying to display the same partial from another controller ,
 orders#new

 orders_controller.rb
  def new
    @project = Project.find(params[:project_id])
  end

 VIEWS
 orders/new.html.haml
        .span4= render :partial = projects/right_show

 but then I get a routing error
 No route matches {:action=change_photo, :controller=projects}
 Try running rake routes for more information on available routes

 I tried to pass the @project object
 = render :partial = projects/right_show, :object = @project

 but no way ,   Routing Error ..
 and the rake routes doesn't show me anything wrong or missing ...

Compare the generated html for the one that works and the one that
doesn't (View  Page Source or similar in the browser) then you will
see what the difference is and should be able to work out what is
wrong.

Colin

-- 
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.



[Rails] Routing error (route not found) but only for destroy action.

2011-08-22 Thread Stefano
Hi guys

I have many different models and I want to reuse the same code for the
delete button.
So in my helper i have:

def delete_button(item_to_delete)
button_to t('buttons.delete'), :action = destroy, :controller
= item_to_delete.class.to_s.downcase.pluralize
end

Normally i work with paths a la post_path(item_to_destroy) but I cant
find a way of making that work for different models except throwing in
some stupid switch statement which makes the code REALLY ugly..

So the code above throws a route not found error. BUT:
def delete_button(item_to_delete)
button_to t('buttons.delete'), :action = new, :controller =
item_to_delete.class.to_s.downcase.pluralize
end

works just fine.. these are the things that really annoy me about ruby
on rails.

Also.. the most ridiculous thing happens at the moment.. I use the
asset pipeline and after rebooting all javascript code in my file
users.js.coffee doesnt get executed in my browser anymore.. If i put
it in example 'messages.js.coffee' it works just fine. EXACTLY the
same syntax in both files.. I have NO idea why that happens. But
frankly after wasting 1h on that I dont care. Just leave my code in
the wrong file where it works..

-- 
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.



[Rails] Routing Error

2011-05-28 Thread John
I made a button using %= button_to New, :action = click % and have
a method in controller as:
 def click
 end
In app/view/posts/click.html.erb file holds simple hello
message.In router.rb ,i added a route to click action of controller as but
error is there when i click the button it gives the routing error.

No route matches /posts/click
Router.rb file looks like:
Check::Application.routes.draw do
  get posts/index
 resources :posts do

 end
get 'posts/click'

  # The priority is based upon order of creation:
  # first created - highest priority.

  # Sample of regular route:
  #   match 'products/:id' = 'catalog#view'
  # Keep in mind you can assign values other than :controller and :action

  # Sample of named route:
  #   match 'products/:id/purchase' = 'catalog#purchase', :as = :purchase
  # This route can be invoked with purchase_url(:id = product.id)

  # Sample resource route (maps HTTP verbs to controller actions
automatically):
  #   resources :products

  # Sample resource rwith_user/:uoute with options:
  #   resources :products do
  # member do
  #   get 'short'
  #   post 'toggle'
  # end
  #
  # collection do
  #   get 'sold'
  # end
  #   end

  # Sample resource route with sub-resources:
  #   resources :products do
  # resources :comments, :sales
  # resource :seller
  #   end

  # Sample resource rwith_user/:uoute with more complex sub-resources
  #   resources :products do
  # resources :comments
  # resources :sales do
  #   get 'recent', :on = :collection
  # end
  #   end

  # Sample resource route within a namespace:
  #   namespace :admin do
  # # Directs /admin/products/* to Admin::ProductsController
  # # (app/controllers/admin/products_controller.rb)
  # resources :products
  #   end

  # You can have the root of your site routed with root
  # just remember to delete public/index.html.
  # root :to = welcome#index

  # See how all your routes lay out with rake routes

  # This is a legacy wild controller route that's not recommended for
RESTful applications.
  # Note: This route will make all actions in every controller accessible
via GET requests.
  # match ':controller(/:action(/:id(.:format)))'
end

John


 No route matches {:controller=posts,
:action=click}.

John

-- 
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.



Re: [Rails] Routing Error

2011-05-28 Thread Chris Kottom
By default, the HTTP verb for button_to is POST.  If you really want to make
the request as a GET, you need to do it as:

button_to New, :action = click, :method = :get


On Sat, May 28, 2011 at 12:24 PM, John johnsshel...@gmail.com wrote:

 I made a button using %= button_to New, :action = click % and have
 a method in controller as:
  def click
  end
 In app/view/posts/click.html.erb file holds simple
 hello message.In router.rb ,i added a route to click action of controller
 as but error is there when i click the button it gives the routing error.

 No route matches /posts/click
 Router.rb file looks like:
 Check::Application.routes.draw do
   get posts/index
  resources :posts do

  end
 get 'posts/click'

   # The priority is based upon order of creation:
   # first created - highest priority.

   # Sample of regular route:
   #   match 'products/:id' = 'catalog#view'
   # Keep in mind you can assign values other than :controller and :action

   # Sample of named route:
   #   match 'products/:id/purchase' = 'catalog#purchase', :as = :purchase
   # This route can be invoked with purchase_url(:id = product.id)

   # Sample resource route (maps HTTP verbs to controller actions
 automatically):
   #   resources :products

   # Sample resource rwith_user/:uoute with options:
   #   resources :products do
   # member do
   #   get 'short'
#   post 'toggle'
   # end
   #
   # collection do
   #   get 'sold'
   # end
   #   end

   # Sample resource route with sub-resources:
   #   resources :products do
   # resources :comments, :sales
   # resource :seller
   #   end

   # Sample resource rwith_user/:uoute with more complex sub-resources
   #   resources :products do
   # resources :comments
   # resources :sales do
   #   get 'recent', :on = :collection
   # end
   #   end

   # Sample resource route within a namespace:
   #   namespace :admin do
   # # Directs /admin/products/* to Admin::ProductsController
   # # (app/controllers/admin/products_controller.rb)
   # resources :products
   #   end

   # You can have the root of your site routed with root
   # just remember to delete public/index.html.
   # root :to = welcome#index

   # See how all your routes lay out with rake routes

   # This is a legacy wild controller route that's not recommended for
 RESTful applications.
   # Note: This route will make all actions in every controller accessible
 via GET requests.
   # match ':controller(/:action(/:id(.:format)))'
 end

 John


  No route matches {:controller=posts,
 :action=click}.

 John

 --
 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.


-- 
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.



Re: [Rails] Routing Error

2011-05-28 Thread john shelfer
On Sat, May 28, 2011 at 7:25 AM, Chris Kottom ch...@chriskottom.com wrote:

 By default, the HTTP verb for button_to is POST.  If you really want to
 make the request as a GET, you need to do it as:

 button_to New, :action = click, :method = :get


  Well.I did it but failed.Same error persists.
 %= button_to New, :action = click,:method = :get %

  John



-- 
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.



Re: [Rails] Routing Error

2011-05-28 Thread Chris Kottom
Head is spinning from trying to keep up with the various threads and email
aliases that seem to be trying to solve the same problem.

From what I see, you've got a mess in your routes file.  According to the
code you posted to this thread, you've got a resource defined plus two
non-resourceful routes, one of which seems to be trying to overlap with your
resource and one of which should be defined as an additional resourceful
route on the resource.

Now you have:

get posts/index
resources :posts do
end
get 'posts/click'


I think you're probably trying to get to this:

resources :posts do
  get 'click', :on = :member
end


I don't know what the click action is supposed to be doing, but you may need
to replace :member with :collection if the method acts on all posts instead
of a single one.

If that doesn't help, you're going to need to be more specific and attach
log snippet and output from rake routes.


On Sat, May 28, 2011 at 2:50 PM, john shelfer johnsshel...@gmail.comwrote:



 On Sat, May 28, 2011 at 7:25 AM, Chris Kottom ch...@chriskottom.comwrote:

 By default, the HTTP verb for button_to is POST.  If you really want to
 make the request as a GET, you need to do it as:

 button_to New, :action = click, :method = :get


  Well.I did it but failed.Same error persists.
 %= button_to New, :action = click,:method = :get %

  John


  --
 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.


-- 
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.



[Rails] Routing Error

2011-04-26 Thread amrit pal pathak
Generated a controller rails generate controller say and then added
a method to id named hello as.
 def hello
 end
Made a file /app/view/say/hello.html.erb
as sudo gedit hello.html.erb and add follwoing to it

html
head
titleHello, Rails!/title
/head
body
h1Hello from Rails!/h1
/body
/html

Browse to locahost:3000/say/hello gives
the error
Routing Error
No route matches /say/hello.html.erb


Amrit pal

-- 
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.



[Rails] Routing Error

2011-04-26 Thread amrit pal pathak
Generated a controller rails generate controller say and then added
a method to id named hello as.
 def hello
 end
Made a file /app/view/say/hello.html.erb
as sudo gedit hello.html.erb and add follwoing to it

html
head
titleHello, Rails!/title
/head
body
h1Hello from Rails!/h1
/body
/html

Browse to locahost:3000/say/hello gives
the error
Routing Error
No route matches /say/hello.html.erb


Amrit pal

-- 
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.



[Rails] Routing error with OmniAuth

2011-04-14 Thread skt
Hello,

I am trying to use OmniAuth with Devise and I am stumbling on some
initial step. When I go to localhost:3000/auth/twitter I get a routing
error

No route matches /auth/twitter

I have the gem omniauth in my gemfile and I have omniauth.rb where I
have setup twitter connection as below

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :twitter, 'MY KEY', 'MY SECRET'
end

The server starts up fine - the home page loads. I am on Ruby
1.9.2p180 and Rails 3.0.5 on a Win box.

Thanks for any pointers on what I may be missing here.
-S

-- 
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.



Re: [Rails] Routing error with OmniAuth

2011-04-14 Thread Phil Crissman
Phil


On Thu, Apr 14, 2011 at 6:29 PM, skt stibre...@gmail.com wrote:

 Hello,

 I am trying to use OmniAuth with Devise and I am stumbling on some
 initial step. When I go to localhost:3000/auth/twitter I get a routing
 error

 No route matches /auth/twitter

 I have the gem omniauth in my gemfile and I have omniauth.rb where I
 have setup twitter connection as below

 Rails.application.config.middleware.use OmniAuth::Builder do
  provider :twitter, 'MY KEY', 'MY SECRET'
 end

 The server starts up fine - the home page loads. I am on Ruby
 1.9.2p180 and Rails 3.0.5 on a Win box.

 Thanks for any pointers on what I may be missing here.


Given the error, you're probably missing a route. The gem does not provide
automatically provide one (at least, it didn't when I used it), you'll need
to add it to the routes file.


 -S

 --
 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.



-- 
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.



[Rails] Routing Error : No route matches / (for Hello World! action)

2011-04-07 Thread Bruce Wilson
My routes.rb reads at the top:

Hello::Application.routes.draw do
  match ':controller(/:action(/:id(.:format)))'

and then all the commented material it comes with and an end at the
end of the file.

But when I type http://localhost:3000 into my browser I get the
following error message:

Routing Error
No route matches /

I'm stumped.

Bruce

-- 
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.



[Rails] routing error for a nested controller and rspec

2011-02-09 Thread slava
Hello,
I am getting a strange error when using rspec with nested routes

it 'succeeds' do
  get :index, @parameters
  response.should be_success
end
...

 Failure/Error: get :index, @parameters
 ActionController::RoutingError:
   No route matches {:website=#Website id: 1, name: Website1,
base_url: http://somewebsite1.net;, created_at: 2011-02-09
18:57:31, updated_at: 2011-02-09
18:57:31, :controller=website_users}

my routes.rb

...
resources :websites
resources :users, :controller = 'website_users'
end

rake routes
...
website_users GET/websites/:website_id/
users(.:format)
{:action=index, :controller=website_users}
 POST   /websites/:website_id/
users(.:format)
{:action=create, :controller=website_users}
new_website_user GET/websites/:website_id/users/
new(.:format)
{:action=new, :controller=website_users}
   edit_website_user GET/websites/:website_id/users/:id/
edit(.:format){:action=edit, :controller=website_users}
website_user GET/websites/:website_id/
users/:id(.:format)
{:action=show, :controller=website_users}
 PUT/websites/:website_id/
users/:id(.:format)
{:action=update, :controller=website_users}
 DELETE /websites/:website_id/
users/:id(.:format)
{:action=destroy, :controller=website_users}
..

-- 
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.



Re: [Rails] Routing Error

2011-02-05 Thread vishal singh
uncomment the last line  in config/routes.rb  like #match(controller:id
:format)

-- 
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.



Re: [Rails] Routing Error

2011-02-05 Thread loganathan sellappa
form_for @event, :url = add_attendees_event_path, :remote = true do |f|


try this

-- 
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.



Re: [Rails] Routing Error

2011-01-31 Thread Norbert Melzer
Hi Garrett!

I'm not exactly sure about this, but don't have you to specify :method =
:post on this?

HTH Norbert

Top posted from Androidphone

Am 29.01.2011 02:00 schrieb Garrett Lancaster 
glanc...@garrettlancaster.com:
 Hey guys, I've been banging my head on this one: doing a remote post with

 = form_for @event, :url = add_attendees_event_path(@event), :remote =
 true do |f|

 No route matches /events/498/add_attendees

 #routes.rb
 resources :events do
 post :add_attendees, :on = :member
 end

 $ rake routes
 #= add_attendees_event POST /events/:id/add_attendees(.:format)

 Any ideas?

 Thanks,
 Garrett

 --
 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.comrubyonrails-talk%2bunsubscr...@googlegroups.com
.
 For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


-- 
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.



[Rails] Routing Error

2011-01-28 Thread Conor
Hey All,

Fairly new to all this, and having a routing problem I just cannot
figure out.


My routes.rb has:
--

  resources :users do
member do
  get 'following'
end
  end


My users_controller.rb has:
--

  def following
@title = Following
@user = User.find(params[:id])
@users = @user.following.paginate(:page = params[:page])
render 'show_follow'
  end

  def followers
@title = Followers
@user = User.find(params[:id])
@users = @user.followers.paginate(:page = params[:page])
render 'show_follow'
  end


In one of my views I'm using:
--

  following_user_path(@user)


Which results in the following error:
--

  No route matches {:action=following, :controller=users}


Can anyone help?

-- 
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.



[Rails] Routing Error

2011-01-28 Thread Garrett Lancaster

Hey guys, I've been banging my head on this one: doing a remote post with

= form_for @event, :url = add_attendees_event_path(@event), :remote = 
true do |f|


No route matches /events/498/add_attendees

#routes.rb
resources :events do
  post :add_attendees, :on =  :member
end

$ rake routes
#=  add_attendees_event POST   /events/:id/add_attendees(.:format)

Any ideas?

Thanks,
Garrett

--
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.



[Rails] Routing error

2011-01-23 Thread Kostas L.
Hi guys,
i have a model named project and i have created routes namespace:
  namespace :project do
resources :inprocess do
  get 'assign', :on = :collection
end
resources :suggested do
  get 'select_list', :on = :collection
  post 'select_list', :on = :collection
end
   resources :finished
  end

One of the routes that i get is new_project_suggested (which is
working fine with the new action) and the edit_project_suggested which
i get an error.
I am calling this action in the select_list view:

% @suggested.each do |s| %
  trtd%= link_to #{s.title}, edit_project_suggested_path(s)
%td/tr
  % end %

The strange is that it does go to the url 
http://127.0.0.1:3000/project/suggested/21/edit
but i get the error Routing Error uninitialized constant
ProjectController.

The actions in the project/suggested controller are:
  def select_list
@suggested = Project.find_all_by_status(suggested)
  end

  def edit
@project = Project.find(params[:id])
  end

Can you help me with this?? It does not make sense! :/

Thank u in advance

-- 
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.



[Rails] Routing Error

2010-12-06 Thread Priya Buvan
Hi All,

While i'm trying to load a page in the browser, i'm getting the
following error.

No route matches /applications/youtube/index.html with {:method=:get}

ActionController::RoutingError (No route matches
/applications/youtube/index.html with {:method=:get}):
  /usr/lib/ruby/1.8/action_controller/routing/recognition_optimisation.rb:66:in
`recognize_path'
  /usr/lib/ruby/1.8/action_controller/routing/route_set.rb:441:in
`recognize'
  /usr/lib/ruby/1.8/action_controller/routing/route_set.rb:436:in `call'
  /usr/lib/ruby/1.8/action_controller/dispatcher.rb:87:in `dispatch'
  /usr/lib/ruby/1.8/action_controller/dispatcher.rb:121:in `_call'
  /usr/lib/ruby/1.8/action_controller/dispatcher.rb:130:in
`build_middleware_stack'
  /usr/lib/ruby/1.8/action_controller/string_coercion.rb:25:in `call'
  /usr/lib/ruby/1.8/action_controller/string_coercion.rb:25:in `call'
  /usr/lib/ruby/1.8/rack/head.rb:9:in `call'
  /usr/lib/ruby/1.8/rack/methodoverride.rb:24:in `call'
  /usr/lib/ruby/1.8/action_controller/params_parser.rb:15:in `call'
  /usr/lib/ruby/1.8/action_controller/session/cookie_store.rb:93:in
`call'
  /usr/lib/ruby/1.8/action_controller/failsafe.rb:26:in `call'
  /usr/lib/ruby/1.8/rack/lock.rb:11:in `call'
  /usr/lib/ruby/1.8/rack/lock.rb:11:in `synchronize'
  /usr/lib/ruby/1.8/rack/lock.rb:11:in `call'
  /usr/lib/ruby/1.8/action_controller/dispatcher.rb:114:in `call'
  /usr/lib/ruby/1.8/action_controller/reloader.rb:34:in `run'
  /usr/lib/ruby/1.8/action_controller/dispatcher.rb:108:in `call'
  /usr/lib/ruby/1.8/rack/urlmap.rb:47:in `call'
  /usr/lib/ruby/1.8/rack/urlmap.rb:41:in `each'
  /usr/lib/ruby/1.8/rack/urlmap.rb:41:in `call'
  /usr/lib/ruby/1.8/rack/content_length.rb:13:in `call'
  /usr/lib/ruby/1.8/rack/handler/webrick.rb:48:in `service'
  /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
  /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
  /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
  /usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
  /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
  /usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
  /usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
  /usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
  /usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
  /usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
  /usr/lib/ruby/1.8/rack/handler/webrick.rb:14:in `run'

Rendering rescues/layout (not_found)


Please help me. I'm not able to rectify the bug.

Thanks,
Buvana

-- 
Posted via http://www.ruby-forum.com/.

-- 
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-t...@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.



Re: [Rails] Routing Error

2010-12-06 Thread rajeevsharma86
please post  some code here yours controllers index method and routs.rb
line which contains this URL

On Mon, Dec 6, 2010 at 3:35 PM, Priya Buvan li...@ruby-forum.com wrote:

 Hi All,

 While i'm trying to load a page in the browser, i'm getting the
 following error.

 No route matches /applications/youtube/index.html with {:method=:get}

 ActionController::RoutingError (No route matches
 /applications/youtube/index.html with {:method=:get}):

  /usr/lib/ruby/1.8/action_controller/routing/recognition_optimisation.rb:66:in
 `recognize_path'
  /usr/lib/ruby/1.8/action_controller/routing/route_set.rb:441:in
 `recognize'
  /usr/lib/ruby/1.8/action_controller/routing/route_set.rb:436:in `call'
  /usr/lib/ruby/1.8/action_controller/dispatcher.rb:87:in `dispatch'
  /usr/lib/ruby/1.8/action_controller/dispatcher.rb:121:in `_call'
  /usr/lib/ruby/1.8/action_controller/dispatcher.rb:130:in
 `build_middleware_stack'
  /usr/lib/ruby/1.8/action_controller/string_coercion.rb:25:in `call'
  /usr/lib/ruby/1.8/action_controller/string_coercion.rb:25:in `call'
  /usr/lib/ruby/1.8/rack/head.rb:9:in `call'
  /usr/lib/ruby/1.8/rack/methodoverride.rb:24:in `call'
  /usr/lib/ruby/1.8/action_controller/params_parser.rb:15:in `call'
  /usr/lib/ruby/1.8/action_controller/session/cookie_store.rb:93:in
 `call'
  /usr/lib/ruby/1.8/action_controller/failsafe.rb:26:in `call'
  /usr/lib/ruby/1.8/rack/lock.rb:11:in `call'
  /usr/lib/ruby/1.8/rack/lock.rb:11:in `synchronize'
  /usr/lib/ruby/1.8/rack/lock.rb:11:in `call'
  /usr/lib/ruby/1.8/action_controller/dispatcher.rb:114:in `call'
  /usr/lib/ruby/1.8/action_controller/reloader.rb:34:in `run'
  /usr/lib/ruby/1.8/action_controller/dispatcher.rb:108:in `call'
  /usr/lib/ruby/1.8/rack/urlmap.rb:47:in `call'
  /usr/lib/ruby/1.8/rack/urlmap.rb:41:in `each'
  /usr/lib/ruby/1.8/rack/urlmap.rb:41:in `call'
  /usr/lib/ruby/1.8/rack/content_length.rb:13:in `call'
  /usr/lib/ruby/1.8/rack/handler/webrick.rb:48:in `service'
  /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
  /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
  /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
  /usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
  /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
  /usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
  /usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
  /usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
  /usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
  /usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
  /usr/lib/ruby/1.8/rack/handler/webrick.rb:14:in `run'

 Rendering rescues/layout (not_found)


 Please help me. I'm not able to rectify the bug.

 Thanks,
 Buvana

 --
 Posted via http://www.ruby-forum.com/.

 --
 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-t...@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.




-- 
Thanks:
Rajeev sharma
+919013155133

-- 
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-t...@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.



[Rails] Routing error for custom POST route in Rails 3

2010-10-18 Thread atotic
I've been banging my head against this for a while, and would love to
see someone prove that I am just overlooking something simple.

I am trying to add a custom route to my RESTful resource. Because
route is destructive, I want to use POST http method. If I hack my
routes.rb to use GET, everything works just fine:

2 different server runs, only difference is get vs. post in my
routes.rb

Started POST /maps/1/reload_from_deamon for 127.0.0.1 at Sun Oct 17
23:17:32 -0700 2010
ActionController::RoutingError (No route matches /maps/1/
reload_from_deamon):

Started GET /maps/1/reload_from_deamon for 127.0.0.1 at Sun Oct 17
23:26:53 -0700 2010
  Processing by MapsController#reload_from_deamon as HTML

Here are my symptoms:

routes.rb
  resources :maps do
 member do
post 'reload_from_deamon'
  end
   end
# i've also tried
#  resources :maps do
#post 'reload_from_deamon', :on = :member
# and
# match 'maps/:id/reload_from_deamon' =
maps#reload_from_deamon, :via = :post

MapsController
  def reload_from_deamon
@map = Map.find(params[:id])
status = @map.reload_from_deamon
redirect_to @map, :notice = status
  end

I generate my post form as following, this might be what is killing
me. I've been unable to coerce form_for to generate the proper POST
url for me.

%= form_for @map, :url = map_path(@map)+ /reload_from_deamon do |
f| -%
button type=submit class=button onclick=document.location = '/
maps/1'
img alt= src=/images/web-app-theme/icons/
database_refresh.pngRefresh readers from deamon
/button
% end -%

Any ideas?

Aleks
Aleks

-- 
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-t...@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.



[Rails] Routing Error

2010-10-13 Thread rajul
my register.html.erb   file is :

% form_for :user do |form| %
pbr /
fieldset
legendEnter Your Detail/legend
  Screen Name
  input type=text name=screen_name id=screen_name size=20
maxlength=40/

 /p
  p
  Email
  input type=text name=email id=email size=30
  maxlength=50/

/p
pPassword
  input type=password name=password id=password size=10
  maxlength=40/

/p
/fieldset
p
  input type=submit name=register id=register
value=Register! /
/p


%end%



and my user controller is

class UserController  ApplicationController

  def index
  end

  def register
@title=Register
if request.post? and params[:user]
@user = User.new(params[:user])
if @user.save
render :text =user created!
end
end

  end

end


my application.html.erb is
!DOCTYPE html
html
head
  titleMy web Site/title
  %= stylesheet_link_tag site %
  %= javascript_include_tag :defaults %
  %= csrf_meta_tag %

/head
body
h1My Website/h1
p
%=link_to Register,:action =register, 
:controller=user%|
%=link_to Index,:action=index,:controller=site%|
%=link_to About Us,:action=about,:controller=site%|
%=link_to Help,:action=help,:controller=site%
/p

div id=content
%= @contenet_for_layout%
/div
p
% if ENV[RAILS_ENV] == development %
%= debug(params)%
% end %

/p

%= yield %


/body
/html



i dont no why i am getting routing error when i am click register
button



-- 
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-t...@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.



Re: [Rails] Routing Error

2010-10-13 Thread radhames brito
First of all , why arent you been restful?? your register action is the same
as a new action, rails creates the right routes for it with
resource :user if you name that action new instead of register, you can use
the :as method to make it say what you want in the url string. second why
are you testing the http method? that is a requirement the router handles.
and last , what is this for : @title=Register ?

-- 
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-t...@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.



Re: [Rails] Routing Error

2010-10-13 Thread radhames brito

 First of all , why arent you been restful?? your register action is the
 same as a new action, rails creates the right routes for it with
 resource :user if you name that action new instead of register, you can
 use the :as method to make it say what you want in the url string. second
 why are you testing the http method? that is a requirement the router
 handles. and last , what is this for : @title=Register ?


sorry i said you should name the action new but you should name it create

-- 
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-t...@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.



[Rails] Routing error

2010-09-08 Thread pauld
Am working my way thru Ruby on Rails Tutorial: Learn Rails by Example
and am on this page:

http://railstutorial.org/chapters/static-pages#top

Am getting problems when I create an HTML page in the public directory
which is called public/hello.html and should appear as in Figure 3.3.

My problem is that when I try to create the page and make it appear at
http://localhost:3000/hello.html I don't see the rendered page.
Instead, I get an error which says Routing error No route matches /
hello.html

I have not made any changes to the routing; I thought that Rails was
supposed to be smart enough to find hello.html because it's in the
same directory as the public/index.html page and the name of the
page is hello.html?

Can you please explain?

Paul Denlinger

-- 
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-t...@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.



Re: [Rails] Routing error

2010-09-08 Thread Colin Law
On 8 September 2010 10:01, pauld paul.denlin...@gmail.com wrote:
 Am working my way thru Ruby on Rails Tutorial: Learn Rails by Example
 and am on this page:

 http://railstutorial.org/chapters/static-pages#top

 Am getting problems when I create an HTML page in the public directory
 which is called public/hello.html and should appear as in Figure 3.3.

 My problem is that when I try to create the page and make it appear at
 http://localhost:3000/hello.html I don't see the rendered page.
 Instead, I get an error which says Routing error No route matches /
 hello.html

 I have not made any changes to the routing; I thought that Rails was
 supposed to be smart enough to find hello.html because it's in the
 same directory as the public/index.html page and the name of the
 page is hello.html?

Could you just triple check the file name in public and in the url you
are typing.  I believe the webserver looks in public first and only
goes on to look at routing if it cannot find it there.  Does it work
if you ask for index.html?  Is so I suspect a simple error somewhere.
Perhaps you have a space on the end of the filename for example.  You
could try renaming the file to what you think it already is.

Colin

-- 
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-t...@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.



Re: [Rails] Routing error

2010-09-08 Thread radhames brito
if the page is static is has to be in the public folder and rails does not
interacts with it , its served by the webserver (webrick )
if its a static page but you are testing how tails work or is dinamic and
you put it in a  app/views/ folder you could have a controller for it, then
rails works like this in your config directory there is a file called
routes.rb , in it are the definidtions of how rails reads the url string,
there should be two that say

 map.connect ':controller/:action/:id'
 map.connect ':controller/:action/:id.:format'


this means that rails will interpret the url string in that sequence, it
will look for a controller after the http:localhost:3000/ with a matching
name to the one in that
position in the url string then it will look for a template with the name in
tha position.

so try commenting those 2 lines in the routes.rb file and see if you get the
hello.html file






On Wed, Sep 8, 2010 at 8:18 AM, Colin Law clan...@googlemail.com wrote:

 On 8 September 2010 10:01, pauld paul.denlin...@gmail.com wrote:
  Am working my way thru Ruby on Rails Tutorial: Learn Rails by Example
  and am on this page:
 
  http://railstutorial.org/chapters/static-pages#top
 
  Am getting problems when I create an HTML page in the public directory
  which is called public/hello.html and should appear as in Figure 3.3.
 
  My problem is that when I try to create the page and make it appear at
  http://localhost:3000/hello.html I don't see the rendered page.
  Instead, I get an error which says Routing error No route matches /
  hello.html
 
  I have not made any changes to the routing; I thought that Rails was
  supposed to be smart enough to find hello.html because it's in the
  same directory as the public/index.html page and the name of the
  page is hello.html?

 Could you just triple check the file name in public and in the url you
 are typing.  I believe the webserver looks in public first and only
 goes on to look at routing if it cannot find it there.  Does it work
 if you ask for index.html?  Is so I suspect a simple error somewhere.
 Perhaps you have a space on the end of the filename for example.  You
 could try renaming the file to what you think it already is.

 Colin

 --
 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-t...@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.



-- 
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-t...@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.



[Rails] Routing Error

2010-08-20 Thread Adam
Hi!
I deployed my app in my shared hosting. If I open dispatch.fcgi, i get
this error:

Routing Error

No route matches /public/dispatch.fcgi with {:method=:get}
Before this app works fine in localhost. Whats wrong?

-- 
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-t...@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.



[Rails] Routing Error in rails 3.0

2010-06-16 Thread karnati kiran
Hi All,


$rails g controller Pages home contact

then, I go to http://localhost:3000/pages/home

I got

Routing Error

No route matches /pages/contact

How can I fix this problem?

Thanks!

-- 
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-t...@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.



Re: [Rails] Routing Error in rails 3.0

2010-06-16 Thread Ivan Nastyukhin
hi
show your routes please

Ivan Nastyukhin
dieinz...@me.com






On Jun 16, 2010, at 10:31 AM, karnati kiran wrote:

 Hi All,
 
 
 $rails g controller Pages home contact
 
 then, I go to http://localhost:3000/pages/home
 
 I got
 
 Routing Error
 
 No route matches /pages/contact
 
 
 How can I fix this problem?
 
 Thanks!
 
 -- 
 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-t...@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.

-- 
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-t...@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.



[Rails] Routing error in Rails 3

2010-03-20 Thread rjunee
I'm hoping someone can advise me on how to debug this routing error.

My routes.rb includes:
  resources :prospects, :only = [create]

rake routes shows:
  prospects POST /prospects(.:format)
{:controller=prospects, :action=create}

However when I try to post a form I get:

Started POST /prospects for 127.0.0.1 at 2010-03-20 01:44:29

ActionController::RoutingError (No route matches /prospects):

Rendered /Users/ryan/.rvm/gems/ruby-1.9.1-p378/gems/
actionpack-3.0.0.beta/lib/action_dispatch/middleware/templates/rescues/
routing_error.erb within /Users/ryan/.rvm/gems/ruby-1.9.1-p378/gems/
actionpack-3.0.0.beta/lib/action_dispatch/middleware/templates/rescues/
layout.erb (0.9ms)


Any ideas?

-- 
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-t...@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.



Re: [Rails] Routing error in Rails 3

2010-03-20 Thread Conrad Taylor
On Sat, Mar 20, 2010 at 1:52 AM, rjunee r...@junee.org wrote:

 I'm hoping someone can advise me on how to debug this routing error.

 My routes.rb includes:
  resources :prospects, :only = [create]

 rake routes shows:
  prospects POST /prospects(.:format)
 {:controller=prospects, :action=create}

 However when I try to post a form I get:

 Started POST /prospects for 127.0.0.1 at 2010-03-20 01:44:29

 ActionController::RoutingError (No route matches /prospects):

 Rendered /Users/ryan/.rvm/gems/ruby-1.9.1-p378/gems/
 actionpack-3.0.0.beta/lib/action_dispatch/middleware/templates/rescues/
 routing_error.erb within /Users/ryan/.rvm/gems/ruby-1.9.1-p378/gems/
 actionpack-3.0.0.beta/lib/action_dispatch/middleware/templates/rescues/
 layout.erb (0.9ms)


 Any ideas?


Hi, how are you trying to post the form?

-Conrad


 --
 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-t...@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.



-- 
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-t...@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.



[Rails] Routing Error using Paperclip

2010-02-26 Thread Rajinder Yadav
For some reason I can't figure out why I am getting a routing error when 
I add Paperclip support. I have another test app when similar code is 
working.


I created a new test app first without Paperclip support and it was 
doing the CRUD operation fine. However when I added Paperclip support I 
get the following error?


Routing Error
user_url failed to generate from {:action=show, :controller=users, 
:id=#User id: nil, name: Rajinder, surname: Yadav, email: 
t...@email.com, password: hello, membership_level: 0, location: nil, 
timezone: nil, bday: nil, last_visit: nil, visits: nil, created_at: nil, 
updated_at: nil, photo_file_name: devmentor.jpg, photo_content_type: 
image/jpeg, photo_file_size: 34846}, expected: {:action=show, 
:controller=users}, diff: {:id=#User id: nil, name: Rajinder, 
surname: Yadav, email: t...@email.com, password: password, 
membership_level: 0, location: nil, timezone: nil, bday: nil, 
last_visit: nil, visits: nil, created_at: nil, updated_at: nil, 
photo_file_name: devmentor.jpg, photo_content_type: image/jpeg, 
photo_file_size: 34846}



The form I am using to submit looks like this

% form_for @user, :html = { :multipart = true } do |f| %
  %= f.label :name %br/
  %= f.text_field :name %br/
  %= f.label :surname %br/
  %= f.text_field :surname %br/
  %= f.label :email %br/
  %= f.text_field :email %br/
  %= f.label :password %br/
  %= f.password_field :password  %br/
  p
%= f.label 'Picture' %
%= f.file_field :photo%
  /p
  %= submit_tag 'Create Account' %
% end %


and the entries in routes.rb are

  map.resources :users
  map.connect ':controller/:action/:id'
  map.connect ':controller/:action/:id.:format'

--
Kind Regards,
Rajinder Yadav

--
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-t...@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.



[Rails] Routing Error on rails3

2010-02-26 Thread John Wu
Hi All,

I am new to Ruby on Rails and have rails3 installed.

After I type this on the command line

$rails g controller Pages home contact

then, I go to http://localhost:3000/pages/home

I got

Routing Error

No route matches /pages/contact

How can I fix this problem?

Thanks!
-- 
Posted via http://www.ruby-forum.com/.

-- 
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-t...@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.



Re: [Rails] Routing Error on rails3

2010-02-26 Thread Conrad Taylor
On Fri, Feb 26, 2010 at 12:47 PM, John Wu li...@ruby-forum.com wrote:

 Hi All,

 I am new to Ruby on Rails and have rails3 installed.

 After I type this on the command line

 $rails g controller Pages home contact

 then, I go to http://localhost:3000/pages/home

 I got

 Routing Error

 No route matches /pages/contact

 How can I fix this problem?

 Thanks!


Please post your routes file.

-Conrad


 --
 Posted via http://www.ruby-forum.com/.

 --
 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-t...@googlegroups.com.
 To unsubscribe from this group, send email to
 rubyonrails-talk+unsubscr...@googlegroups.comrubyonrails-talk%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/rubyonrails-talk?hl=en.



-- 
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-t...@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.



Re: [Rails] Routing Error on rails3

2010-02-26 Thread Colin Law
On 26 February 2010 20:47, John Wu li...@ruby-forum.com wrote:
 Hi All,

 I am new to Ruby on Rails and have rails3 installed.

Did you really mean to start with rails 3?  It is still under
development and you may well run into problems that are not of your
own making.  If you are learning rails I would suggest installing the
latest 2.3.x and you will find getting started guides to help you get
going at http://guides.rubyonrails.org.  I believe that it is
necessary to uninstall rails 3 before installing 2.3.x though I may be
mistaken.

Colin

-- 
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-t...@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.



[Rails] Routing error: Double slash in resources

2009-12-18 Thread Marqueti


Hi,

I get a application running over:

Rails 2.3.5, Application is set 2.1.0 at enviroment.rb

Ruby: 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.2.0]

The Urls are generated right, but the resources like stylesheets,
javascripts are generated with double slashes.

ex: link href=http://127.0.0.1:3000//stylesheets/style.css?
1254514155 media=screen rel=stylesheet type=text/css /

This working before I upgrade the mac to snow leopard. I update all
following these guides (http://hivelogic.com/articles/compiling-ruby-
rubygems-and-rails-on-snow-leopard/)

Somebody know how I can fix it?

Tks!

--

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-t...@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.




Re: [Rails] Routing Error

2009-12-06 Thread Leonardo Mateo
On Sun, Dec 6, 2009 at 8:16 AM, procedure...@gmail.com
procedure...@gmail.com wrote:
 Routing Error

 No route matches /object1/object2/392 with {:method=:get}

 object2 имеет view - object2.rhtml.erb and controller - object1.rb.
 Which contains a method:

 def object2
 �...@user = ObjectProfile.find(params[:id])
 end


 help solve the problem please. I think the problem is routing.But I do
 not know how to solve it.

If object2 is a method of Object1Controller, other than the resource's
methods, you need to define the route on your routes.rb file.
If you haven't read the routing guide[1], I STRONGLY recommend you to
do that before continue.

Hope it helps.

Cheers.

[1]http://guides.rubyonrails.org/routing.html

-- 
Leonardo Mateo.
There's no place like ~

--

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-t...@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.




[Rails] Routing error

2009-11-16 Thread Todd A. Jacobs

I got a routing error when trying to create a note object from inside a
property object:

Routing Error
property_url failed to generate from {:action=show, 
:controller=properties, :id=nil}, expected: {:controller=properties, 
:action=show}, diff: {:id=nil} 

Here's what's going on:

# Show action from the properties controller
def show
@property = Property.find(params[:id])
@note = @property.notes.new
respond_to do |format|
format.html
format.xml{ render :xml = @property }
end
end

# Create action from the notes controller
def create
@note = Note.new(params[:note])
@note.user_id = current_user.id
respond_to do |format|
if @note.save
flash[:notice] = 'Note was successfully created.'
format.html { redirect_to property_path @note.property_id }
format.xml{ render :xml = @note, :status = :created, 
:location = @note }
else
format.html { render :action = new }
format.xml{ render :xml = @note.errors, :status = 
:unprocessable_entity }
end
end
end

# show.html.erb for properties
% form_for @note do |f| %
  %= f.error_messages %
  p
%= f.label 'New note:' %br /
%= f.text_area :text %
  /p
  p
%= f.submit 'Save note' %
  /p
% end %

The form displays correctly, but gives a routing error when saving. I'm
not sure what the error is trying to tell me.

This works fine from the console, insofar as I can call
@no...@property.note.new; @note.save and have it save successfully.
How can I do it from a view?

Ultimately, the goal is to populate notes linked to the property_id
without resorting to either hidden fields (insecure) or session
variables. I thought a form was the way to go, but I'm really stuck.
 
-- 
Oh, look: rocks!
-- Doctor Who, Destiny of the Daleks


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Rails] Routing Error if using ssl_required

2009-10-17 Thread Adam Meyer

Hi everyone,

I am running into a routing error when activating ssl.
Everything works fine, when I put

ssl_required :index

into the controller I get a routing error

Routing Error

No route matches /meinkwikit with {:method=:get}

I installed the ssl plugin and putinclude SslRequirement into my
application_controller.

Does anybody know what I am doing wrong?

Thanks in advance

Adam
-- 
Posted via http://www.ruby-forum.com/.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Rails] Routing Error with Rails 2.3.3

2009-08-20 Thread CCH

Hi All

This piece of code works in Rails 1.2
aimg src=/images/crm.jpg/a

But crashes in Rails 2.2.3

Processing ApplicationController#index (for 127.0.0.1 at 2009-08-21
10:22:23) [GET]

ActionController::RoutingError (No route matches /images/crm.jpg
with {:method=:get}):
  -e:2:in `load'
  -e:2

Rendering rescues/layout (not_found)

How can I configure the correct route in routes.rb ?

TIA

CCH
http://cch4rails.blogspot.com
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Rails] Routing Error

2009-07-19 Thread duh

I tried posting this this morning but never saw it show up.  I'll try
again.

I'm using InstantRails with Sqlite3.  Last night I was able to access
my webpages just fine.  This morning, none of them were working.  Kept
getting the Routing Error message.

No routing.rb files were changed.  THis is aggravating.  Anyone know
how I can diagnose this problem?


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Rails] Routing error

2009-07-18 Thread Dwight Shackelford

Routing Error

No route matches /cookbook with {:method=:get}

This problem started this morning, whereas it was working last night.
Occurring with all projects.  No routing.rb files were changed by me.

I'm using InstantRails/Sqlite3 and Mongrel.

I don't even know how to start diagnosing this.  I'm a noob.  Taking a
class.  Mongrel base page comes up fine.

Any help appreciated.
-- 
Posted via http://www.ruby-forum.com/.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Rails] Routing Error

2009-06-17 Thread Tyler Knappe

I have a problem with my routing.  When a user performs an illegal
checkout action (end time  start time) it should route back to to the
'checkout' action.  However, it is instead going to the 'edit' action.

b'rake routes' /b

 users GET/users(.:format)   {:controller=users,
:action=index}
  POST   /users(.:format)
{:controller=users, :action=create}
 new_user GET/users/new(.:format)
{:controller=users, :action=new}
edit_user GET/users/:id/edit(.:format)
{:controller=users, :action=edit}
 user GET/users/:id(.:format)
{:controller=users, :action=show}
  PUT/users/:id(.:format)
{:controller=users, :action=update}
  DELETE /users/:id(.:format)
{:controller=users, :action=destroy}
  new_session GET/session/new(.:format)
{:controller=sessions, :action=new}
 edit_session GET/session/edit(.:format)
{:controller=sessions, :action=edit}
  session GET/session(.:format)
{:controller=sessions, :action=show}
  PUT/session(.:format)
{:controller=sessions, :action=update}
  DELETE /session(.:format)
{:controller=sessions, :action=destroy}
  POST   /session(.:format)
{:controller=sessions, :action=create}
 labs GET/labs(.:format)
{:controller=labs, :action=index}
  POST   /labs(.:format)
{:controller=labs, :action=create}
  new_lab GET/labs/new(.:format)
{:controller=labs, :action=new}
 edit_lab GET/labs/:id/edit(.:format)
{:controller=labs, :action=edit}
  lab GET/labs/:id(.:format)
{:controller=labs, :action=show}
  PUT/labs/:id(.:format)
{:controller=labs, :action=update}
  DELETE /labs/:id(.:format)
{:controller=labs, :action=destroy}
   lab_categories GET/lab_categories(.:format)
{:controller=lab_categories, :action=index}
  POST   /lab_categories(.:format)
{:controller=lab_categories, :action=create}
 new_lab_category GET/lab_categories/new(.:format)
{:controller=lab_categories, :action=new}
edit_lab_category GET/lab_categories/:id/edit(.:format)
{:controller=lab_categories, :action=edit}
 lab_category GET/lab_categories/:id(.:format)
{:controller=lab_categories, :action=show}
  PUT/lab_categories/:id(.:format)
{:controller=lab_categories, :action=update}
  DELETE /lab_categories/:id(.:format)
{:controller=lab_categories, :action=destroy}
   checkout_index GET/checkout(.:format)
{:controller=checkout, :action=index}
  POST   /checkout(.:format)
{:controller=checkout, :action=create}
 new_checkout GET/checkout/new(.:format)
{:controller=checkout, :action=new}
edit_checkout GET/checkout/:id/edit(.:format)
{:controller=checkout, :action=edit}
  GET/checkout/:id(.:format)
{:controller=checkout, :action=show}
  PUT/checkout/:id(.:format)
{:controller=checkout, :action=update}
  DELETE /checkout/:id(.:format)
{:controller=checkout, :action=destroy}
login/
{:controller=sessions, :action=new}
   signup/signup
{:controller=users, :action=new}
myaccount/myaccount
{:controller=myaccount, :action=myaccount}
   logout/logout
{:controller=sessions, :action=destroy}
 /labs/checkout/:id
{:controller=checkout, :action=checkout}
 /labs/checkout/:id/update
{:controller=checkout, :action=update}
 checkout/labs/checkout/:id/edit
{:controller=checkout, :action=update}
 root/
{:controller=home, :action=index}
 /:controller/:action/:id
 /:controller/:action/:id(.:format)

routes.rb:
 map.checkout '/labs/checkout/:id', :controller = 'checkout', :action
= 'checkout'
  map.checkout '/labs/checkout/:id/update', :controller = 'checkout',
:action = 'update'
  map.checkout '/labs/checkout/:id/edit', :controller = 'checkout',
:action = 'update'
  map.root :controller = home

# default routes
  map.connect ':controller/:action/:id'
  map.connect ':controller/:action/:id.:format'

bCheckoutController update action: /b

 def update
@lab = Lab.find(params[:id])

respond_to do |format|
if @lab.update_attributes(params[:lab])
flash[:notice] = 'Lab was successfully
updated.'
format.html { redirect_to(@lab) }
format.xml  { head :ok }
else
format.html { render :action =
checkout }
format.xml  { render :xml =
@lab.errors, :status = :unprocessable_entity }
end
end
  end

bLabController update /b

def update
@lab = 

[Rails] Routing Error with Passenger for Images and stylesheets

2009-05-30 Thread John T.

Hi,

I updated my server with the latest Rails (2.3.2) and Passenger (2.2.2).
I also updated my Rails app to run under 2.3.2. It runs
fine locally under Mongrel.

The app is deployed into my own home directory under: (deployed via
Capistrano)
  /users/me/public_html/myapp/current   (which is a symlink to the
actual app)
and it's accessed by the url:
  http://myserver.com/myapp

I was getting routing errors, where Passenger/Apache could not find the
default route. But I found a post saying Passenger
has an issue with routing, so I added the RailsBaseURI to the
environment.rb file:

config.action_controller.relative_url_root = /myapp

I found another post that said my apache config should be:

VirtualHost *:80
  ServerName myserver.com
  DocumentRoot /home/me/public_html/myapp/current/public
  Directory /home/me/public_html/myapp/current/public
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
  /Directory
  RailsBaseURI /
/VirtualHost

I have not .htaccess file in the public folder.

I am now able to get to the app, but all references to stylesheets and
images are giving routing errors in the
production.log file:

Processing ApplicationController#index (for 1.2.3.4 at 2009-05-30
13:11:46) [GET]

ActionController::RoutingError (No route matches
/stylesheets/scaffold.css with {:method=:get}):
  passenger (2.2.2) lib/phusion_passenger/rack/request_handler.rb:81:in
`process_request'
  passenger (2.2.2)
lib/phusion_passenger/abstract_request_handler.rb:203:in `main_loop'
  passenger (2.2.2)
lib/phusion_passenger/railz/application_spawner.rb:340:in
`start_request_handler'
  passenger (2.2.2)
lib/phusion_passenger/railz/application_spawner.rb:298:in
`handle_spawn_application'
  passenger (2.2.2) lib/phusion_passenger/utils.rb:181:in `safe_fork'
  passenger (2.2.2)
lib/phusion_passenger/railz/application_spawner.rb:296:in
`handle_spawn_application'
  passenger (2.2.2) lib/phusion_passenger/abstract_server.rb:337:in
`__send__'
  passenger (2.2.2) lib/phusion_passenger/abstract_server.rb:337:in
`main_loop'
  passenger (2.2.2) lib/phusion_passenger/abstract_server.rb:187:in
`start_synchronously'
  passenger (2.2.2) lib/phusion_passenger/abstract_server.rb:154:in
`start'
  passenger (2.2.2)
lib/phusion_passenger/railz/application_spawner.rb:192:in `start'
  passenger (2.2.2) lib/phusion_passenger/spawn_manager.rb:257:in
`spawn_rails_application'
  passenger (2.2.2)
lib/phusion_passenger/abstract_server_collection.rb:126:in
`lookup_or_add'
  passenger (2.2.2) lib/phusion_passenger/spawn_manager.rb:251:in
`spawn_rails_application'
  passenger (2.2.2)
lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
  passenger (2.2.2)
lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
  passenger (2.2.2) lib/phusion_passenger/spawn_manager.rb:250:in
`spawn_rails_application'
  passenger (2.2.2) lib/phusion_passenger/spawn_manager.rb:153:in
`spawn_application'
  passenger (2.2.2) lib/phusion_passenger/spawn_manager.rb:282:in
`handle_spawn_application'
  passenger (2.2.2) lib/phusion_passenger/abstract_server.rb:337:in
`__send__'
  passenger (2.2.2) lib/phusion_passenger/abstract_server.rb:337:in
`main_loop'
  passenger (2.2.2) lib/phusion_passenger/abstract_server.rb:187:in
`start_synchronously'


I'm at a loss as to how to fix this. Anyone?

Thanks!
-- 
Posted via http://www.ruby-forum.com/.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Rails] Routing Error

2009-05-06 Thread Sj Tib

Folks,

I am a little lost on a Routing error in accessing my javascripts and
stylesheets files on production and hopefully someone can help me.

Part of what is confusing me is that the same code that works fine on my
XP dev box is giving this Routing error when I put it up on the hosting
site in production environment. The only difference being the
environment itself (prod vs. dev) and that the javascripts and
stylesheets directories are symbolic links on production instead of
actual directories as on my local dev box.

For files like /javascripts/path/to/my.js and /stylesheets/myapp.css
I get error message like


ActionController::RoutingError (No route matches
/stylesheets/myapp.css with {:method=:get}):
/vendor/rails/actionpack/lib/action_controller/routing/recognition_optimisation.rb:66:in
`recognize_path'

I have looked at the routes.rb (included below) long enough but can't
see what is causing this Routing error.

I also started up a script_console and after loading up
ActionController::Routing::Routes in a variable the recognize_path for
stylesheets/myapp.css fails with the same error but it brings up the
page fine on that dev box without any errors - which is a little
confusing as well.

Here is what I have in my routes.rb

  map.resources :users, :collection = { :resetpwd = :get, :getnewpwd
= :get, :getpwdresetcode = :post }

  map.resource :session, :controller = 'session', :collection = {
:welcome_home = :get}

  map.root :controller = 'session', :action = 'new'
  map.activate '/activate/:activation_code', :controller = 'users',
:action = 'activate', :activation_code = nil
  map.resetpwd '/resetpwd/:resetpwd_code', :controller = 'users',
:action = 'resetpwd', :resetpwd_code = nil
  map.signup '/signup', :controller = 'users', :action = 'new'
  map.login '/login', :controller = 'session', :action = 'new'
  map.logout '/logout', :controller = 'session', :action = 'destroy'

  map.connect ':controller/:action/:id'
  map.connect ':controller/:action/:id.:format'


Sounds like I am missing something simple.

Appreciate any thoughts/pointers.

Thanks,
-S
-- 
Posted via http://www.ruby-forum.com/.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Rails] Routing error?

2009-04-09 Thread Ali

I hope this will be an easy question...

I'm trying to migrate from Rails 1.2 to 2.1, and I must admit, the
routing is somewhat confusing me.

When I update a form, I'm getting a routing error.  (No route matches
{id}) It's because the update statement is getting assembled
incorrectly somehow and the action is getting set to the id instead of
update!  I don't understand how this is happening.  Does it have to
do with routing?

Here's my development.log showing what I'm talking about.

Parameters: {commit=Save,
authenticity_token=5d5f2530096051f30a11d94701281b54a537a012,
action=13,
adminbillingrate={rate=30, employeetype_codeid=119},
controller=adminbillingrates}

Any help would be appreciated as always!!
~Ali

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Rails] Routing error in nested resources

2009-03-31 Thread Carlos Santana

I am using nested resources as follows:
  map.resources :topics do |topics|
topics.resources :items do |items|
  items.resources :attachments
end
  end

When I generate a RESTful path for new item in the console:
app.new_topic_item_path(2) then I get correct path as
'/topics/2/items/new'.

However, for the new attachment I am getting error:
app.new_topic_item_attachment_path(22) gives -
ActionController::RoutingError: new_topic_item_attachment_url failed to
generate from {:action=new, :controller=attachments,
:topic_id=22}, expected: {:controller=attachments, :action=new},
diff: {:topic_id=22}

from
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/routing/route_set.rb:375:in
`raise_named_route_error'
from
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/routing/route_set.rb:339:in
`generate'
from
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/url_rewriter.rb:131:in
`rewrite_path'
from
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/url_rewriter.rb:110:in
`rewrite_url'
from
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/url_rewriter.rb:88:in
`rewrite'
from
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/integration.rb:218:in
`url_for'
from (eval):17:in `new_topic_item_attachment_path'
from (irb):5.

- - - - -

Why is it failing and how to fix this?
And, why is it generating '{:action=new, :controller=attachments,
:topic_id=22}' ? Shouldn't it pass item_id rather than topic_id?

Any clues?

-
Thanks,
CS.
-- 
Posted via http://www.ruby-forum.com/.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Rails] routing error

2009-02-19 Thread Sony Sebastian

Hello,

   I have set up an application using scaffolding, which have all
basic method(index/new/edit/show/..). But when I tried to add a new
method it showing routing errors.

~~~

class ItemsController  ApplicationController
def index
..
end
def new
..
end

...

def list
(New method which I have created)
end

end


~~~

Error what I am getting is that,

Couldn't find Item with ID=list


How can I configure my routes.rb to avoid the issue.

Waiting for ur reply...
-- 
Posted via http://www.ruby-forum.com/.

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Rails] Routing error for application

2009-01-17 Thread Ramya

Hi,

I am to learning  Ruby on Rails with Rolling with Ruby on Rails
orilley handout.

I created an empty application by using rails command.

Then i created my own controller using the command.

ruby script \generate controller MyTest
This created a new controller file.

I used the port http://127.0.0.1:3000/My_Test after starting the rails
inbuilt server.

but i get the Routing Error.

No route matches /My_Test/index with {:method=:get}

but when i just give the port alone it says Ruby on rails running in
your system.

I just followed the tutorial but couldnt get through this step.

http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html?page=2


Can anybody help me with this

Regards
Ramya
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---