Tag Archives: DRY

Sharing New and Edit Forms With Partials

How can you share the form to create a new object and to edit an object? The fields are almost the same–this is a goal that will help you keep your site DRY, with the forms specified in one place. Rails partials to the rescue! You can put the fields into a partial, and simply render that in both your new and edit actions. Easy! Continue reading

Posted in Development | Tagged , | Comments Off

Image_Tag and Link_To Helpers

All websites face an issue of: how can I refer to my images in a way that won’t break if I move my site to a new location? Image_Tag helper to the rescue! Similarly, how can you write links to specific controllers and actions, so that if you change things around, the site won’t break? Link_To to the rescue! These helpers provide simple, easy-to-use functionality to help keep your site DRY. Continue reading

Posted in Development | Tagged , , | 4 Comments