Hi, I made a contact manager app using rails. I added TokenInput plugin to introduce an instant contact search functionality in it. Tried following a railscast http://railscasts.com/episodes/258-token-fields but have been struggling with it for a while. Following is the code I use in my view <%= form_tag({:action => ''show'', :id => @contact_tokens}, :remote => true,> :method=> :get) do %> > <div id="search"> > <%= label_tag "contact_tokens" %> > <%= text_field_tag "contact_tokens", @contact_tokens %> > </div> > > <div class="action"> > <%= submit_tag "Show Details" %> > </div> > <% end %> >Where, Show is the action where this particular contact will be displayed. But when I am trying to render this view, it show following error, No matching routes found for {controller "Contacts", action "Show" id=>nil"} I am not able to understand why is it showing id as nil. Or say why isn''t anything being passed from the text field used for the search. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/Wq6-L9EzBU8J. For more options, visit https://groups.google.com/groups/opt_out.
On 13 August 2012 07:12, Sumit Srivastava <sumit.theinvincible-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I made a contact manager app using rails. I added TokenInput plugin to > introduce an instant contact search functionality in it. Tried following a > railscast http://railscasts.com/episodes/258-token-fields but have been > struggling with it for a while. Following is the code I use in my view > >> <%= form_tag({:action => ''show'', :id => @contact_tokens}, :remote => true, >> :method=> :get) do %> >> <div id="search"> >> <%= label_tag "contact_tokens" %> >> <%= text_field_tag "contact_tokens", @contact_tokens %> >> </div> >> >> <div class="action"> >> <%= submit_tag "Show Details" %> >> </div> >> <% end %> > > > Where, Show is the action where this particular contact will be displayed. > But when I am trying to render this view, it show following error, > > No matching routes found for {controller "Contacts", action "Show" id=>nil"} > > I am not able to understand why is it showing id as nil. Or say why isn''t > anything being passed from the text field used for the search.Have a look in log/development.log to see what parameters are being passed when you click the link. Then have a look at the Rails Guide on Debugging which will show you techniques that you can use to debug the code. 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
I went through the log. The contact_tokens parameter is being passed as nil, i.e., "contact_tokens"=>"". This is happening even when the text field is actually populated. Regards Sumit Srivastava The power of imagination makes us infinite... On 13 August 2012 12:27, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 13 August 2012 07:12, Sumit Srivastava <sumit.theinvincible-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > Hi, > > > > I made a contact manager app using rails. I added TokenInput plugin to > > introduce an instant contact search functionality in it. Tried following > a > > railscast http://railscasts.com/episodes/258-token-fields but have been > > struggling with it for a while. Following is the code I use in my view > > > >> <%= form_tag({:action => ''show'', :id => @contact_tokens}, :remote => > true, > >> :method=> :get) do %> > >> <div id="search"> > >> <%= label_tag "contact_tokens" %> > >> <%= text_field_tag "contact_tokens", @contact_tokens %> > >> </div> > >> > >> <div class="action"> > >> <%= submit_tag "Show Details" %> > >> </div> > >> <% end %> > > > > > > Where, Show is the action where this particular contact will be > displayed. > > But when I am trying to render this view, it show following error, > > > > No matching routes found for {controller "Contacts", action "Show" > id=>nil"} > > > > I am not able to understand why is it showing id as nil. Or say why isn''t > > anything being passed from the text field used for the search. > > Have a look in log/development.log to see what parameters are being > passed when you click the link. Then have a look at the Rails Guide > on Debugging which will show you techniques that you can use to debug > the code. > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On 13 August 2012 08:40, sumit srivastava <sumit.theinvincible-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I went through the log. The contact_tokens parameter is being passed as nil, > i.e., "contact_tokens"=>"". > > This is happening even when the text field is actually populated.Can you post that section of the log please. (And please don''t top post, it makes it difficult to follow the thread. Insert your reply inline in previous message. Thanks)> The power of imagination makes us infinite...I am quite happy the size I am thanks. Colin> > > On 13 August 2012 12:27, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> >> On 13 August 2012 07:12, Sumit Srivastava <sumit.theinvincible-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> wrote: >> > Hi, >> > >> > I made a contact manager app using rails. I added TokenInput plugin to >> > introduce an instant contact search functionality in it. Tried following >> > a >> > railscast http://railscasts.com/episodes/258-token-fields but have been >> > struggling with it for a while. Following is the code I use in my view >> > >> >> <%= form_tag({:action => ''show'', :id => @contact_tokens}, :remote => >> >> true, >> >> :method=> :get) do %> >> >> <div id="search"> >> >> <%= label_tag "contact_tokens" %> >> >> <%= text_field_tag "contact_tokens", @contact_tokens %> >> >> </div> >> >> >> >> <div class="action"> >> >> <%= submit_tag "Show Details" %> >> >> </div> >> >> <% end %> >> > >> > >> > Where, Show is the action where this particular contact will be >> > displayed. >> > But when I am trying to render this view, it show following error, >> > >> > No matching routes found for {controller "Contacts", action "Show" >> > id=>nil"} >> > >> > I am not able to understand why is it showing id as nil. Or say why >> > isn''t >> > anything being passed from the text field used for the search. >> >> Have a look in log/development.log to see what parameters are being >> passed when you click the link. Then have a look at the Rails Guide >> on Debugging which will show you techniques that you can use to debug >> the code. >> >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On Monday, 13 August 2012 14:02:11 UTC+5:30, Colin Law wrote:> > On 13 August 2012 08:40, sumit srivastava <sumit.the...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org<javascript:>> > wrote: > > I went through the log. The contact_tokens parameter is being passed as > nil, > > i.e., "contact_tokens"=>"". > > > > This is happening even when the text field is actually populated. > > Can you post that section of the log please. (And please don''t top > post, it makes it difficult to follow the thread. Insert your reply > inline in previous message. Thanks) >Here is the log, Started GET "/contacts/212?utf8=%E2%9C%93&contact_tokens=&commit=Show+Details" for 127.0.0.1 at Mon Aug 13 13:08:33 +0530 2012 Processing by ContactsController#show as JS Parameters: {"utf8"=>"✓", "id"=>"212", "commit"=>"Show Details", "contact_tokens"=>""} User Load (0.2ms) SELECT "users".* FROM "users" WHERE (username =''sumit'') LIMIT 1 Contact Load (0.2ms) SELECT "contacts".* FROM "contacts" WHERE "contacts"."id" = ? LIMIT 1 [["id", "212"]] Rendered contacts/_show.html.erb (0.8ms) Rendered contacts/show.js.erb (2.0ms) Completed 200 OK in 7ms (Views: 4.1ms | ActiveRecord: 0.4ms)> > The power of imagination makes us infinite... > > I am quite happy the size I am thanks. > > Colin > > > > > > > On 13 August 2012 12:27, Colin Law <cla...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org <javascript:>> > wrote: > >> > >> On 13 August 2012 07:12, Sumit Srivastava <sumit.the...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org<javascript:>> > > >> wrote: > >> > Hi, > >> > > >> > I made a contact manager app using rails. I added TokenInput plugin > to > >> > introduce an instant contact search functionality in it. Tried > following > >> > a > >> > railscast http://railscasts.com/episodes/258-token-fields but have > been > >> > struggling with it for a while. Following is the code I use in my > view > >> > > >> >> <%= form_tag({:action => ''show'', :id => @contact_tokens}, :remote => > >> >> true, > >> >> :method=> :get) do %> > >> >> <div id="search"> > >> >> <%= label_tag "contact_tokens" %> > >> >> <%= text_field_tag "contact_tokens", @contact_tokens %> > >> >> </div> > >> >> > >> >> <div class="action"> > >> >> <%= submit_tag "Show Details" %> > >> >> </div> > >> >> <% end %> > >> > > >> > > >> > Where, Show is the action where this particular contact will be > >> > displayed. > >> > But when I am trying to render this view, it show following error, > >> > > >> > No matching routes found for {controller "Contacts", action "Show" > >> > id=>nil"} > >> > > >> > I am not able to understand why is it showing id as nil. Or say why > >> > isn''t > >> > anything being passed from the text field used for the search. > >> > >> Have a look in log/development.log to see what parameters are being > >> passed when you click the link. Then have a look at the Rails Guide > >> on Debugging which will show you techniques that you can use to debug > >> the code. > >> > >> 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 rubyonra...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<javascript:>. > > >> To unsubscribe from this group, send email to > >> rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>. > >> 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 rubyonra...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<javascript:>. > > > To unsubscribe from this group, send email to > > rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org <javascript:>. > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/_g-6sY85LA4J. For more options, visit https://groups.google.com/groups/opt_out.
On 13 August 2012 10:19, sumit srivastava <sumit.theinvincible-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> >> > > On 13 August 2012 14:33, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> >> On 13 August 2012 09:45, Sumit Srivastava <sumit.theinvincible-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> wrote: >> > >> > >> > On Monday, 13 August 2012 14:02:11 UTC+5:30, Colin Law wrote: >> >> >> >> On 13 August 2012 08:40, sumit srivastava <sumit.the...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> >> wrote: >> >> > I went through the log. The contact_tokens parameter is being passed >> >> > as >> >> > nil, >> >> > i.e., "contact_tokens"=>"". >> >> > >> >> > This is happening even when the text field is actually populated. >> >> >> >> Can you post that section of the log please. (And please don''t top >> >> post, it makes it difficult to follow the thread. Insert your reply >> >> inline in previous message. Thanks) >> > >> > >> > Here is the log, >> > Started GET >> > "/contacts/212?utf8=%E2%9C%93&contact_tokens=&commit=Show+Details" for >> > 127.0.0.1 at Mon Aug 13 13:08:33 +0530 2012 >> > Processing by ContactsController#show as JS >> > Parameters: {"utf8"=>"✓", "id"=>"212", "commit"=>"Show Details", >> > "contact_tokens"=>""} >> > User Load (0.2ms) SELECT "users".* FROM "users" WHERE (username >> > =''sumit'') >> > LIMIT 1 >> > Contact Load (0.2ms) SELECT "contacts".* FROM "contacts" WHERE >> > "contacts"."id" = ? LIMIT 1 [["id", "212"]] >> > Rendered contacts/_show.html.erb (0.8ms) >> > Rendered contacts/show.js.erb (2.0ms) >> > Completed 200 OK in 7ms (Views: 4.1ms | ActiveRecord: 0.4ms) >> >> Strange. I suggest checking there is no error in the html of the page >> with the form on. Copy the complete html source out of your browser >> (View > Page Source or similar) and paste it into the w3c html >> validator at http://validator.w3.org/#validate_by_input. >> >> Colin >> > > Here is my code, validator was marking ruby code as errors.What do you mean it was marking the ruby code as errors? It is the html that you are supposed to be validating. Colin> >> >> <div id="welcome"> >> <%= render ''welcome'' %> >> </div></br> >> >> Search : >> <%= form_tag({:action => ''show'', :id => "212", :contact_tokens => >> @contact_tokens}, :remote => true, :method=> :get) do %> >> >> <div id="search"> >> <%= label_tag "contact_tokens" %> >> <%= text_field_tag "contact_tokens", @contact_tokens %> >> </div> >> >> <div id="showdetails" style="display:none"> >> >> <%= submit_tag "Show Details" %> >> </div> >> <% end %> > > >> >> <p>Listing contacts</p> >> <%= javascript_include_tag ''lowpro'' %> >> <% javascript_include_tag ''pagination'' %> >> >> <div id="contacts"> >> <%= render ''contact'' %> >> </div> >> > > >> >> >> >> > >> > >> >> >> >> > The power of imagination makes us infinite... >> >> >> >> I am quite happy the size I am thanks. >> >> >> >> Colin >> >> >> >> > >> >> > >> >> > On 13 August 2012 12:27, Colin Law <cla...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> >> >> >> >> >> On 13 August 2012 07:12, Sumit Srivastava <sumit.the...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> >> >> wrote: >> >> >> > Hi, >> >> >> > >> >> >> > I made a contact manager app using rails. I added TokenInput >> >> >> > plugin >> >> >> > to >> >> >> > introduce an instant contact search functionality in it. Tried >> >> >> > following >> >> >> > a >> >> >> > railscast http://railscasts.com/episodes/258-token-fields but have >> >> >> > been >> >> >> > struggling with it for a while. Following is the code I use in my >> >> >> > view >> >> >> > >> >> >> >> <%= form_tag({:action => ''show'', :id => @contact_tokens}, :remote >> >> >> >> => >> >> >> >> true, >> >> >> >> :method=> :get) do %> >> >> >> >> <div id="search"> >> >> >> >> <%= label_tag "contact_tokens" %> >> >> >> >> <%= text_field_tag "contact_tokens", @contact_tokens %> >> >> >> >> </div> >> >> >> >> >> >> >> >> <div class="action"> >> >> >> >> <%= submit_tag "Show Details" %> >> >> >> >> </div> >> >> >> >> <% end %> >> >> >> > >> >> >> > >> >> >> > Where, Show is the action where this particular contact will be >> >> >> > displayed. >> >> >> > But when I am trying to render this view, it show following error, >> >> >> > >> >> >> > No matching routes found for {controller "Contacts", action "Show" >> >> >> > id=>nil"} >> >> >> > >> >> >> > I am not able to understand why is it showing id as nil. Or say >> >> >> > why >> >> >> > isn''t >> >> >> > anything being passed from the text field used for the search. >> >> >> >> >> >> Have a look in log/development.log to see what parameters are being >> >> >> passed when you click the link. Then have a look at the Rails Guide >> >> >> on Debugging which will show you techniques that you can use to >> >> >> debug >> >> >> the code. >> >> >> >> >> >> 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 rubyonra...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> >> >> To unsubscribe from this group, send email to >> >> >> rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> >> >> 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 rubyonra...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> >> > To unsubscribe from this group, send email to >> >> > rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> >> > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
On 13 August 2012 15:09, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 13 August 2012 10:19, sumit srivastava <sumit.theinvincible-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > >> > > > > On 13 August 2012 14:33, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > >> > >> On 13 August 2012 09:45, Sumit Srivastava < > sumit.theinvincible-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > >> wrote: > >> > > >> > > >> > On Monday, 13 August 2012 14:02:11 UTC+5:30, Colin Law wrote: > >> >> > >> >> On 13 August 2012 08:40, sumit srivastava <sumit.the...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > >> >> wrote: > >> >> > I went through the log. The contact_tokens parameter is being > passed > >> >> > as > >> >> > nil, > >> >> > i.e., "contact_tokens"=>"". > >> >> > > >> >> > This is happening even when the text field is actually populated. > >> >> > >> >> Can you post that section of the log please. (And please don''t top > >> >> post, it makes it difficult to follow the thread. Insert your reply > >> >> inline in previous message. Thanks) > >> > > >> > > >> > Here is the log, > >> > Started GET > >> > "/contacts/212?utf8=%E2%9C%93&contact_tokens=&commit=Show+Details" for > >> > 127.0.0.1 at Mon Aug 13 13:08:33 +0530 2012 > >> > Processing by ContactsController#show as JS > >> > Parameters: {"utf8"=>"✓", "id"=>"212", "commit"=>"Show Details", > >> > "contact_tokens"=>""} > >> > User Load (0.2ms) SELECT "users".* FROM "users" WHERE (username > >> > =''sumit'') > >> > LIMIT 1 > >> > Contact Load (0.2ms) SELECT "contacts".* FROM "contacts" WHERE > >> > "contacts"."id" = ? LIMIT 1 [["id", "212"]] > >> > Rendered contacts/_show.html.erb (0.8ms) > >> > Rendered contacts/show.js.erb (2.0ms) > >> > Completed 200 OK in 7ms (Views: 4.1ms | ActiveRecord: 0.4ms) > >> > >> Strange. I suggest checking there is no error in the html of the page > >> with the form on. Copy the complete html source out of your browser > >> (View > Page Source or similar) and paste it into the w3c html > >> validator at http://validator.w3.org/#validate_by_input. > >> > >> Colin > >> > > > > Here is my code, validator was marking ruby code as errors. > > What do you mean it was marking the ruby code as errors? It is the > html that you are supposed to be validating. > > Colin > >I verified the html for the view. No error related to the form was found. What else could be the problem?> > > >> > >> <div id="welcome"> > >> <%= render ''welcome'' %> > >> </div></br> > >> > >> Search : > >> <%= form_tag({:action => ''show'', :id => "212", :contact_tokens => > >> @contact_tokens}, :remote => true, :method=> :get) do %> > >> > >> <div id="search"> > >> <%= label_tag "contact_tokens" %> > >> <%= text_field_tag "contact_tokens", @contact_tokens %> > >> </div> > >> > >> <div id="showdetails" style="display:none"> > >> > >> <%= submit_tag "Show Details" %> > >> </div> > >> <% end %> > > > > > >> > >> <p>Listing contacts</p> > >> <%= javascript_include_tag ''lowpro'' %> > >> <% javascript_include_tag ''pagination'' %> > >> > >> <div id="contacts"> > >> <%= render ''contact'' %> > >> </div> > >> > > > > > >> > >> > >> > >> > > >> > > >> >> > >> >> > The power of imagination makes us infinite... > >> >> > >> >> I am quite happy the size I am thanks. > >> >> > >> >> Colin > >> >> > >> >> > > >> >> > > >> >> > On 13 August 2012 12:27, Colin Law <cla...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > >> >> >> > >> >> >> On 13 August 2012 07:12, Sumit Srivastava <sumit.the...-Re5JQEeQqe8@public.gmane.orgm > > > >> >> >> wrote: > >> >> >> > Hi, > >> >> >> > > >> >> >> > I made a contact manager app using rails. I added TokenInput > >> >> >> > plugin > >> >> >> > to > >> >> >> > introduce an instant contact search functionality in it. Tried > >> >> >> > following > >> >> >> > a > >> >> >> > railscast http://railscasts.com/episodes/258-token-fields but > have > >> >> >> > been > >> >> >> > struggling with it for a while. Following is the code I use in > my > >> >> >> > view > >> >> >> > > >> >> >> >> <%= form_tag({:action => ''show'', :id => @contact_tokens}, > :remote > >> >> >> >> => > >> >> >> >> true, > >> >> >> >> :method=> :get) do %> > >> >> >> >> <div id="search"> > >> >> >> >> <%= label_tag "contact_tokens" %> > >> >> >> >> <%= text_field_tag "contact_tokens", @contact_tokens %> > >> >> >> >> </div> > >> >> >> >> > >> >> >> >> <div class="action"> > >> >> >> >> <%= submit_tag "Show Details" %> > >> >> >> >> </div> > >> >> >> >> <% end %> > >> >> >> > > >> >> >> > > >> >> >> > Where, Show is the action where this particular contact will be > >> >> >> > displayed. > >> >> >> > But when I am trying to render this view, it show following > error, > >> >> >> > > >> >> >> > No matching routes found for {controller "Contacts", action > "Show" > >> >> >> > id=>nil"} > >> >> >> > > >> >> >> > I am not able to understand why is it showing id as nil. Or say > >> >> >> > why > >> >> >> > isn''t > >> >> >> > anything being passed from the text field used for the search. > >> >> >> > >> >> >> Have a look in log/development.log to see what parameters are > being > >> >> >> passed when you click the link. Then have a look at the Rails > Guide > >> >> >> on Debugging which will show you techniques that you can use to > >> >> >> debug > >> >> >> the code. > >> >> >> > >> >> >> 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 rubyonra...-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm > . > >> >> >> To unsubscribe from this group, send email to > >> >> >> rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > >> >> >> 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 rubyonra...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org. > >> >> > To unsubscribe from this group, send email to > >> >> > rubyonrails-ta...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > >> >> > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
On 13 August 2012 10:52, sumit srivastava <sumit.theinvincible-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> ... > I verified the html for the view. No error related to the form was found. > What else could be the problem?Make sure there are no errors at all, if there are any errors anywhere on the page you cannot be sure that anything will work, as the browser is having to guess what you meant and sometimes it gets it wrong. It is the most basic rule of debugging, first fix all the problems that are clearly identified. You cannot imagine the amount of time that is wasted trying to track down a tricky bug, whilst saying "that simple error that I know about cannot possibly cause this other problem in an entirely different bit of code" which in the end turns out to be a side effect of the first problem. So fix all the html validation problems first. It may not fix the submit problem but you have to do it sometime after all, so do it now. The next time you find a website that is behaving strangely or does not look right then paste the url into the validator (I expect you saw that you can give it a url rather than paste in the code) and it is very likely there are errors. The site may well have been tested in one browser and the errors did not appear to matter. Using another browser, or even a update to the browser, can change the way it interprets invalid html and the page breaks. 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On 13 August 2012 11:33, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 13 August 2012 10:52, sumit srivastava <sumit.theinvincible-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> ... >> I verified the html for the view. No error related to the form was found. >> What else could be the problem? > > Make sure there are no errors at all, if there are any errors anywhere > on the page you cannot be sure that anything will work, as the browser > is having to guess what you meant and sometimes it gets it wrong. It > is the most basic rule of debugging, first fix all the problems that > are clearly identified. You cannot imagine the amount of time that is > wasted trying to track down a tricky bug, whilst saying "that simple > error that I know about cannot possibly cause this other problem in an > entirely different bit of code" which in the end turns out to be a > side effect of the first problem. So fix all the html validation > problems first. It may not fix the submit problem but you have to do > it sometime after all, so do it now. > > The next time you find a website that is behaving strangely or does > not look right then paste the url into the validator (I expect you saw > that you can give it a url rather than paste in the code) and it is > very likely there are errors. The site may well have been tested in > one browser and the errors did not appear to matter. Using another > browser, or even a update to the browser, can change the way it > interprets invalid html and the page breaks.Hi Sumit. Have you solved this problem? 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Colin, Yes, I did. I was using wrong dom id to save the tokeninput data and that was misleading my app. Regards Sumit Srivastava The power of imagination makes us infinite... On 15 August 2012 13:36, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 13 August 2012 11:33, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > On 13 August 2012 10:52, sumit srivastava <sumit.theinvincible-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > >> ... > >> I verified the html for the view. No error related to the form was > found. > >> What else could be the problem? > > > > Make sure there are no errors at all, if there are any errors anywhere > > on the page you cannot be sure that anything will work, as the browser > > is having to guess what you meant and sometimes it gets it wrong. It > > is the most basic rule of debugging, first fix all the problems that > > are clearly identified. You cannot imagine the amount of time that is > > wasted trying to track down a tricky bug, whilst saying "that simple > > error that I know about cannot possibly cause this other problem in an > > entirely different bit of code" which in the end turns out to be a > > side effect of the first problem. So fix all the html validation > > problems first. It may not fix the submit problem but you have to do > > it sometime after all, so do it now. > > > > The next time you find a website that is behaving strangely or does > > not look right then paste the url into the validator (I expect you saw > > that you can give it a url rather than paste in the code) and it is > > very likely there are errors. The site may well have been tested in > > one browser and the errors did not appear to matter. Using another > > browser, or even a update to the browser, can change the way it > > interprets invalid html and the page breaks. > > Hi Sumit. Have you solved this problem? > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.