Making a form reset button in Rails

Tags: 

Rails doesn't have reset_tag to automatically make a form reset button, instead you have to take a slightly different route. To make a form reset button in Rails you simply do this:
[source:ruby]
'reset', :id => 'reset_button', :type => "reset" }) %>
[/source]
which will create the following:
[source:html]

[/source]
The important part here is the :type argument, which override's Rails' default of "submit" for the submit_tag. Then, to tidy it up a little I override the :name, which defaults to "commit", and give it a useful id attribute.

Et voila!

Strip HTML in any string in Ruby

Tags: 

A little code snippet to let you remove HTML from any string in Ruby:
[source:ruby]
class String

# remove all HTML tags from the source string
def strip_html
self.gsub(/]*>/, "")
end

end
[/source]
Then to run the code just do this:
[source:ruby]
blurb_html = "

Thanks for visiting our site.

"
blurb_text = blurb_html.strip_html
[/source]

Amazing PR thanks to Ryan Price

After today I owe Ryan Price a huge debt of honor, and at least one beverage of his choice. Mr Price, a well known figure in the Orlando, FL internet-savvy community, just promoted my search for employment on his community site's blog with many complimentary things to say. He also highlighted how through a limited amount of networking over the past year I've managed to gain a great deal number leads very quickly, which has just been an amazing experience - thanks to the feedback my family will be just fine. A sincere thanks to you, Ryan, you're an honorable and compassionate person!

activeCollab giving up on free edition, open-source

Tags: 

The project management tool activeCollab, previously mentioned here, has just announced their pricing structure for the forthcoming v1.0 release. The key point you'll notice is that they're no longer going to have a free or open-source version available, instead they're pushing their paid releases while they "keep [the old version] 0.7.1 around." There will be two versions available, a "small biz" release for $199 that doesn't have the calendar, trouble tickets, time tracking or static pages, and a $399 version that has these. At this news I'm even more satisfied in my choice to move all my work to using Redmine.

Pages

Subscribe to Front page feed