I have been trying to get Solr up and running and have an app mostly working but simple routes stuff is tripping me up. This is a Rails 3.0 route. PlayingWithSunspot::Application.routes.draw do resources :jobs do collection do get :search end end So, what would the Rails 2.3.11 equivalent be for this route? I can''t seem to get the right syntax though I thought this was an example of a resource route with a complex sub-resource. -- 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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Phil On Sat, Apr 16, 2011 at 9:29 PM, sol.manager <sol.manager-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have been trying to get Solr up and running and have an app mostly > working but simple routes stuff is tripping me up. This is a Rails 3.0 > route. > > PlayingWithSunspot::Application.routes.draw do > resources :jobs do > collection do > get :search > end > end > > > So, what would the Rails 2.3.11 equivalent be for this route? I can''t > seem to get the right syntax though I thought this was an example of a > resource route with a complex sub-resource. >Rails used to do this like: map.resources :jobs, :collection => {:search => :get} You can also still find the rails 2.3.x rails guides, which includes the routing guide, from the index page of http://guides.rubyonrails.org/> > -- > 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 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-/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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Apr 16, 11:58 pm, Phil Crissman <phil.criss...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Phil >I tried this and it isn''t working out. I have a job model. In the views/jobs/index.html.erb file I have the following at the top. <h1>Listing jobs</h1> <%= form_tag search_jobs_path, :method => :get do %> <p> <%= text_field_tag :query, params[:query] %> <%= submit_tag "Search!" %> </p> <% end %> When i put in the route as below and try to pull up the jobs index, I now get a compile error. It does not like this line: <%= form_tag search_jobs_path, :method => :get do %> So what am I missing here?> > map.resources :jobs, :collection => {:search => :get} > > You can also still find the rails 2.3.x rails guides, which includes the > routing guide, from the index page ofhttp://guides.rubyonrails.org/ > > > > > > > -- > > 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 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sun, Apr 17, 2011 at 12:59 PM, sol.manager <sol.manager-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On Apr 16, 11:58 pm, Phil Crissman <phil.criss...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Phil > > > I tried this and it isn''t working out. > I have a job model. In the views/jobs/index.html.erb file I have the > following at the top. > <h1>Listing jobs</h1> > <%= form_tag search_jobs_path, :method => :get do %> > <p> > <%= text_field_tag :query, params[:query] %> <%= submit_tag > "Search!" %> > </p> > <% end %> > > When i put in the route as below and try to pull up the jobs index, I > now get a compile error. It does not like this line: > <%= form_tag search_jobs_path, :method => :get do %> > > So what am I missing here? >What is the error?> > > > > map.resources :jobs, :collection => {:search => :get} > > > > You can also still find the rails 2.3.x rails guides, which includes the > > routing guide, from the index page ofhttp://guides.rubyonrails.org/ > > > > > > > > > > > > > -- > > > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > . > > > To unsubscribe from this group, send email to > > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > 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-/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 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-/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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
The full error message goes something like this: showing app/views/jobs/_search_form.html.erb where line #1 raised: compile error /Users/aesthetica/Apps/blank-r2311/app/views/jobs/ _search_form.html.erb:1: syntax error, unexpected '')'' ...obs_path, :method => :get do ).to_s); @output_buffer.concat ... ^ /Users/aesthetica/Apps/blank-r2311/app/views/jobs/ _search_form.html.erb:6: syntax error, unexpected kENSURE, expecting '')'' /Users/aesthetica/Apps/blank-r2311/app/views/jobs/ _search_form.html.erb:8: syntax error, unexpected kEND, expecting '')'' Extracted source (around line #1): 1: <%= form_tag search_jobs_path, :method => :get do %> 2: <p> 3: <%= text_field_tag :query, params[:query] %> <%= submit_tag "Search!" %> 4: </p> Trace of template inclusion: app/views/jobs/_search_form.html.erb, app/ views/jobs/index.html.erb> > What is the error? >-- 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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sun, Apr 17, 2011 at 4:17 PM, sol.manager <sol.manager-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> The full error message goes something like this: > > showing app/views/jobs/_search_form.html.erb where line #1 raised: > > compile error > /Users/aesthetica/Apps/blank-r2311/app/views/jobs/ > _search_form.html.erb:1: syntax error, unexpected '')'' > ...obs_path, :method => :get do ).to_s); @output_buffer.concat ... > ^ > /Users/aesthetica/Apps/blank-r2311/app/views/jobs/ > _search_form.html.erb:6: syntax error, unexpected kENSURE, expecting > '')'' > /Users/aesthetica/Apps/blank-r2311/app/views/jobs/ > _search_form.html.erb:8: syntax error, unexpected kEND, expecting '')'' > Extracted source (around line #1): > > 1: <%= form_tag search_jobs_path, :method => :get do %> >Problem is not the route, then. This line (above) should not have an ''='' sign at the beginning. Try <% form_tag search_jobs_path, :method => :get do %>> 2: <p> > 3: <%= text_field_tag :query, params[:query] %> <%= submit_tag > "Search!" %> > 4: </p> > Trace of template inclusion: app/views/jobs/_search_form.html.erb, app/ > views/jobs/index.html.erb > > > > > What is the error? > > > > -- > 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 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-/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 this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
This totally fixed the problem and my app is now properly doing Solr full text searches of my jobs model. Thank you for the assistance.> Problem is not the route, then. This line (above) should not have an ''='' > sign at the beginning. Try > > <% form_tag search_jobs_path, :method => :get do %> > > > > > 2: <p> > > 3: <%= text_field_tag :query, params[:query] %> <%= submit_tag > > "Search!" %> > > 4: </p> > > Trace of template inclusion: app/views/jobs/_search_form.html.erb, app/ > > views/jobs/index.html.erb > > > > What is the error? > > > -- > > 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 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Google doesn''t seem to want to post my reply properly. I wanted to say thank you as your last suggestion worked. I removed the offending and my site is working with Solr properly now. Thank you. On Apr 17, 6:05 pm, Phil Crissman <phil.criss...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Sun, Apr 17, 2011 at 4:17 PM, sol.manager <sol.mana...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > The full error message goes something like this: > > > showing app/views/jobs/_search_form.html.erb where line #1 raised: > > > compile error > > /Users/aesthetica/Apps/blank-r2311/app/views/jobs/ > > _search_form.html.erb:1: syntax error, unexpected '')'' > > ...obs_path, :method => :get do ).to_s); @output_buffer.concat ... > > ^ > > /Users/aesthetica/Apps/blank-r2311/app/views/jobs/ > > _search_form.html.erb:6: syntax error, unexpected kENSURE, expecting > > '')'' > > /Users/aesthetica/Apps/blank-r2311/app/views/jobs/ > > _search_form.html.erb:8: syntax error, unexpected kEND, expecting '')'' > > Extracted source (around line #1): > > > 1: <%= form_tag search_jobs_path, :method => :get do %> > > Problem is not the route, then. This line (above) should not have an ''='' > sign at the beginning. Try > > <% form_tag search_jobs_path, :method => :get do %> > > > > > 2: <p> > > 3: <%= text_field_tag :query, params[:query] %> <%= submit_tag > > "Search!" %> > > 4: </p> > > Trace of template inclusion: app/views/jobs/_search_form.html.erb, app/ > > views/jobs/index.html.erb > > > > What is the error? > > > -- > > 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 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.