button_to HTML options not completely intuitive

Tags: 

While working on a site in Rails tonight I was adding a button_to that I wanted a JS confirmation requester. Well, based on my albeit beginner knowledge of Rails I thought the following would work:
[source:ruby]
:empty, :confirm => "Really empty your cart?" %>
[/source]
As it turned out this wouldn't work, it kept adding "?confirm=Really empty your cart?" to the URL instead of doing a popup. A bit of fiddling later I realized that to work correctly the additional arguments to button_to need to be arrays, e.g.:
[source:ruby]
:empty}, {:confirm => "Really empty your cart?"} %>
[/source]

Programming for kids, and older kids

Tags: 

One fault that could be levied at the computer industry is that they've lost a lot of the out-of-the-box creativity experience from the early days, back in the 80's when every computer you bought came out of the box with a programming language that anyone (with a manual or two) could start writing their own Hello World apps. Back then most people didn't learn to program at college, they learned from their $200 home computers. There is a new option for people seeking this experience again called Hackety Hack, a new programming kit based on the existing Ruby language bundled in a really easy-to-use package. Although aimed at children it is also well suited to anyone who wants to try their hand at something a little bit different, and is well worth giving a try.

Nested controllers with Goldberg (UPDATE: fixed in v0.2.1)

Tags: 

The Rails plugin Goldberg is really quite good for kick-starting a site with its permissions system and basic CMS. There is one small bug in it though, it doesn't like adding nested controllers in the admin console. There is, however, a simple work-around: simply go to e.g.:

That will load up the New Controller page which lets you type in a controller name and set the default permissions for it, so all you have to do is type in the name of your new controller, e.g. admin/news, and it'll work just fine from there!

UPDATE: FYI this has been fixed in the latest v0.2.1.

Pages

Subscribe to Front page feed