lucassus / extjs4-account-manager

Ext JS 4 and Ruby on Rails simple CRUD example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Where do baseParams go these days?

oldroy opened this issue · comments

Hello,
Just wondering where 'baseParams' go in the MVC example? If I wanted to add baseParams: { authenticity_token: 'xyz123'}, where would it go? It seems you used to be able to put it on a button or on the form in the past. But it's been since ext 2.1 that I've messed with extjs.

baseParams seems now to be 'extraParams' and can go in the Proxy config in the Model:

In model/Users.js:
proxy: {
url: '/users',
type: 'rest',
format: 'json',
extraParams: authToken,
etc.....

To set the token as a variable in Global scope add this to your layout:

<script type="text/javascript"> var authToken = { authenticity_token: "<%= form_authenticity_token %>" }; </script>

.......