Sometimes it's useful to interact with your controllers via the console. This, as you may know, can be achieved with the app object. You can perform GET, POST, PUT and DELETE requests by doing the following.
If you need to login to your Rails app first, you will need to send a post request to the controller that creates the user session. Most likely, the "sessions" controller - "create" action. First, you'll need to take a note of the fields that are used for the user name and password on the login form. In my case, this is username and password. Now you're ready to send your post request:
Notice, on the first line, that you need to disable forgery protection. I found that I couldn't log in unless I did this. Another thing that I needed to do, was deal with subdomains. For instance, the user (in my app) should only be allowed to log in when a subdomain is specified. You can do this by setting the "host", as seen on the second line on the code snippet above. If all goes well, you should get a 302 response and you can start interacting with the rest of your applications actions:-
Very handy indeed. Also, getting familiar with these commands is useful for when you're writing functional tests.