search for: path_paramet

Displaying 9 results from an estimated 9 matches for "path_paramet".

Did you mean: path_params
2011 Jan 10
0
Can't use ActionDispatch::Request in Rails middleware because path_parameters get lost
Hi, I just encountered a bit of an issue where we call request.params of an ActionDispatch::Request inside a rack middleware right before a Rails 3.0.3 app. The issue is that the path_parameters never appear in the parameters hash if you call request.params before the rails app. It seems that that the requests.params method memoizes itself in "action_dispatch.request.parameters" without the parsed path_parameters. The router seems to properly extract the path params but neve...
2011 Dec 02
0
Testing Views with Rails 3 and Rspec2 - Can't stub request.path_params[:controller]
I am stuck to test a specific view which contains a request.path_parameters[:controller] variable as the example below follows: <%=link_to "Store", admin_stores_url, { :id => "tab-3" ,:class => (admin_stores_path == ''/'' + request.path_parameters[:controller] && ''active'')} %> The rspec view...
2006 Jun 16
0
rake spec controller test output hideus.
...quot;, "password"=>"newpassword", "email"=>"newbob@mcbob.com"}, "action"=>"signup", "controller"=>"user"}, @request=#<ActionController::TestRequest:0x24d6894 @session_options={}, @accepts=nil, @symbolized_path_parameters={:controller=>"user", :action=>"signup"}, @query_parameters={"action"=>"signup"}, @host="test.host", @cookies={}, @env={"REMOTE_ADDR"=>"0.0.0.0", "REQUEST_URI"=>"/user/signup?user=passwordnewpassw...
2010 Jun 15
2
ThreadError: stopping only thread
Running Rails 2.3.5 I am new to Ruby and Rails. From the console I get the following ThreadError below. Any suggestions are very welcome. >> app.get "/slides" => 200 >> app.request.path_parameters => {"action"=>"index", "controller"=>"slides"} >> app.get "/slides/1" ThreadError: stopping only thread note: use sleep to stop forever from c:/ProgramFiles/ruby/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/ac tion_c...
2008 Sep 24
3
caches_page :if not executing (but caches_action :if) does
...an :if bug (which I doubt) or am I misunderstanding? Full example (also in pastie): #In this case, the :if is ignored, and all pages cache class PagesController < ApplicationController caches_page :show, :if => Proc.new {|c| ["home", "something- else"].index(c.request.path_parameters["id"])} before_filter :admin_required, :only => [ :index, :new, :create, :delete, :edit, :update ] before_filter :IP_restricted, :only => [ :index, :new, :create, :delete, :edit, :update ] #In this case, the :if executes correctly class PagesController < ApplicationCon...
2006 Jan 16
15
where''d we come from?
I''m curious -- how many of us came to Rails from other branches of the OO world -- Java, C# -- and how many of us came from the design or non-OO scripting worlds? Reason I ask is that I''m finding Rails a blast and very productive, but I think one reason is that I already cut my teeth on MVC and ORM during two years of writing apps with J2EE/Struts/Hibernate. And in Javaland, it
2006 Feb 24
0
UrlRewriter problem in components
...ck/lib/action_controller/url_rewriter.rb?rev=3534#L44 UrlRewriter calls "Routing::Routes.generate(options.dup, @request)" and passes @request, which is used for url-generation in next step. I''ve made some debug output to point up the problem: puts params puts @request.path_parameters puts url_for :params => { :key => ''value'' } returns {"action"=>"list", "id"=>nil, "controller"=>nil} {"action"=>"index", "controller"=>"items"} "items?key...
2005 May 21
0
How can I get a post-Routing translated url_for?
...y deduce that "/" is in fact equal to {:controller => "info", :action => "welcome"} (see below for UrlHelper#current_page?). Thus, current_page? returns false when it should return true (in my case). So the trail that I''ve taken is this: @request.path_parameters is a hash containing the actual page that I''m visiting (after Routes are taken in to account). This is consistent, regardless of which routing map got me here. Now, the question is, given some :controller and :action, how do I get a translated hash likewise containing :contr...
2007 Jan 31
7
GET request works via curl, crashes from Java
.../gems/activesupport-1.4.0/lib/active_support/dependencies.rb:496:in `require'' script/server:3 Here''s the code in request.rb: # Returns both GET and POST parameters in a single hash. def parameters @parameters ||= request_parameters.update(query_parameters).update(path_parameters).with_indifferent_access end The Java program is expecting an xml file and obviously isn''t getting what it is supposed to: org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Content is not allowed in prolog. I thought it was unlikely to be helpful but I turned $mongr...