rod mclaughlin
Tried clicking on the 'Updates' button on my Ubuntu Linux toolbar,
No luck And so on, and on... dependency hell... just to run the tests Why is Merb so incompatible with Ubuntu, when Rails is always so easy? See How to Install Rails on Ubuntu
merb.lighthouseapp.com/projects/7433-merb/tickets/986-webrat-is-required-for-merb-core-app-running-in-console
Thanks, Sean! Now, where was I? Oh yeah, testing...
...lots of errors ...but that's good, isn't it?
gist.github.com/wycats/merb-plugins/tree/ed3a3cf597477b8a0048922978ec6a1eda591168/merb_auth/slices/merb_auth_password_slice/README.textile
tells you how to set up authentication - except, as usual, Merb has changed since
it was written.
Then it says
Bradly Feeley at
bradlyfeeley.com
Lets start at the beginning and create an app By default merb-gen app will create a user model for you in app/models/user.rb. The model is there, but we still need to create the table in the database and add a user to authenticate with. Lets do that now. To create our first user we can drop into Merb's irb console mode with merb -i. Like Rails' script/console, merb -i gives you access to your models and other classes.
In order to test authentication we need something to protect.
We will need to add a route to the resource also To protect a controller with authentication
we can use the before filter ensure_authenticated Everything should now be setup in our app. Lets give it a run through. First you need to start you merb server. Make sure you are in your merb app’s root directory. Now you can test access to your resource is denied before authentication. Login in and try to access the recourse again. You should now be able to access the resource. Awesome. This worked immediately. Thanks Bradly! I now have a Merb app which forces you to log in in order to access, edit or add articles, which you do with a wysiwyg html editor.
|