Params? #116

brainjuicer opened this Issue Apr 5, 2012 · 3 comments


None yet

2 participants


Hi @mde, it's nice to talk to you again. I have question about the params variable. What exactly is it's use? Is it the way to pass variables between the controllers and the views? Any reply is much appreciated.


@brainjuicer brainjuicer closed this Apr 5, 2012
mde commented Apr 5, 2012

Did you get this figured out? The params property on the controller is a combination of things parsed out of the route (e.g., an ID for a resource-based route), the URL-params, and params from a form POST or PUT.

@brainjuicer brainjuicer reopened this Apr 5, 2012

Well, to be honest I don't think so. My real question is, how do variables get sent between the views and corresponding controllers? I would love to know because I have been banging my head against a wall about this. Thanks.

mde commented Apr 6, 2012

Any variables you want in your views need to be explicitly passed when you render them from a controller-action.

Any key in the object-literal passed to the respond call is available as a local variable in your view. Passing 'params' is just an example of something you can pass in to use in the view. You can use one of the boilerplate views generated by geddy resource, and watch them spit out anything you add to the querystring, because they're just looping over the params passed into the view.

Hope that helps.

@mde mde closed this Apr 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment