Haml breaks pre indentation

Haml has a feature called “Whitespace Preservation” which usually tries to nicely indent your markup. This is great. However, sometimes it gets in your way – especially when it indents your <pre> paragraphs wrong. I had a setup like %p Here, some code! = render_some_code where #render_some_code would return some markup. def render_some_code “include ‘cells’ninclude… Continue reading Haml breaks pre indentation

Getting a bloody Rails 3 generator running. And testing it.

Suck me sideways! It is said the generator layer in Rails 3 got really ohsom, flexible and whatever. I can now confirm “That’s true, somehow.” – nevertheless it took me years to figure out all the internals, conventions and places where to find documentation. What I wanted So here’s my requirement. I have a gem… Continue reading Getting a bloody Rails 3 generator running. And testing it.

I don’t get form_tag

Ok, so I call something like html_options = { :onSubmit => “new Ajax.Request(\”/barn/render_event_response\”)” } form_tag(“barn”, html_options) Can you see my well-escaped JavaScript? However, I get “<form action="/barn/render_event_response" method="post" onsubmit="new Ajax.Request(\"/barn/render_event_response\")" Why does Rails &quot; my JavaScript? Can anybody help?

Rails::Generator destroys Namespaces

The cool thing is that Rails’ script/generator script can be invoked via an API call Rails::Generator::Scripts::Generate.new.run(%w(controller blog), :destination => ‘/tmp’) so you can create assets in your code, or test the generator. Where is my JavascriptGenerator? The bad thing is, that after you used Rails::Generator, you can’t rely on autoloading anymore, at least for classes… Continue reading Rails::Generator destroys Namespaces