How does the HTTP params Hash work?

76 views
Skip to first unread message

Weston Platter

unread,
Aug 28, 2012, 1:25:17 PM8/28/12
to rubyonra...@googlegroups.com
I am working on a Rails engine. When I go from a Main Application route to an Engine route, I think I lose a HTTP param, which I need for a db query. 

My questions are,

1) When and how is the HTTP params Hash modified?

2) Is it possible that switching between a application route and engine route effects the params Hash?

Robert Walker

unread,
Aug 28, 2012, 2:45:03 PM8/28/12
to rubyonra...@googlegroups.com
Weston Platter wrote in post #1073624:
> I am working on a Rails engine. When I go from a Main Application route
> to
> an Engine route, I think I lose a HTTP param, which I need for a db
> query.
>
> *My questions are,*
> *
> *
> *1) When and how is the HTTP params Hash modified?*

AFAIK that all happens here in the Rails/Rack middleware stack.

http://guides.rubyonrails.org/rails_on_rack.html#action-controller-middleware-stack

The middleware that parses the user's data into the params hash is:
ActionDispatch::ParamsParser

At least as I understand it.

> *2) Is it possible that switching between a application route and engine
> route effects the params Hash?*

Sorry, I've not yet created a Rails engine so I don't know the answer to
this part.

--
Posted via http://www.ruby-forum.com/.
Reply all
Reply to author
Forward
0 new messages