At MIX07 a few days ago, Microsoft announced “Silverlight“, a new Flash-esque .NET-based platform for delivering “media experiences” and “rich interactive applications” on the Web. It’s interesting, and some people seem to think it’s going to revolutionize the Web, but that’s not why we’re interested in it at Ruby Inside.
The most interesting part of the [...]
Archive for August, 2007
Silverlight (and Ruby on the .NET CLR)
relative_time_helpers Plugin: time_ago_in_words on Steroids
relative_time_helpers is a straightforward, but very useful Rails plugin by Rick Olson that formats timestamps to human-friendly relative dates. You’re probably already using Rails’ built-in time_ago_in_words helper in your applications, but Rick’s relative_time gives even better results:
<%= relative_time(Time.now) %># today<%= relative_time(1.day.ago) %># yesterday<%= relative_time(1.day.from_now) %># tomorrow<%= relative_time_span([Time.now, 5.days.from_now]) %># May 17th – 22nd
To install it:
script/plugin [...]
Calendar Date Select: A Lightweight, Prototype-based Date/Time Picker for Rails Developers
Calendar Date Select is a new(ish) “date and time picker”, developed by Tim Harper, designed primarily for developers to use in Rails applications. It uses the standard Prototype JavaScript library, and is easily installed as a Rails plugin:
script/plugin install http://calendardateselect.googlecode.com/svn/tags/calendar_date_select
Take a look at the collection of demos of the picker to see its full range.
Rails performance tip – using YSlow
YSlow from Yahoo! is a Firefox add-on to analyse web pages and tell you why they’re slow based on rules for high performance web sites. YSlow requires the indispensable Firebug extension.
The 13 rules YSlow checks your site against are as follows:
1. Make Fewer HTTP Requests2. Use a Content Delivery Network3. Add an Expires Header4. Gzip [...]
How to Profile Your Rails Application and Make Rails Go Vroom!
Charlie Savage, author of ruby-prof, recently baked in support for Rails to ruby-prof, so now it’s possible to profile your Rails application, see where the delays are, and work on improving performance.
Hot on the heels of this development, Charlie wrote “How to Profile Your Application“, an article that does just what it says on the [...]
10 Great New Ruby / Rails Screencasts from July 2007
Railscasts, maintained by Ryan Bates, continues to release one great free screencast after another, with 9 so far this month, although we’re going to include one from June 29 for good measure. We first looked at Railscasts a few months ago, so if you haven’t visited again since, it’s worth it. Here are the latest [...]
How To Scrape Google With Ruby In 0 Seconds
Okay, his title is a bit misleading, but Peter Szinek, developer of Ruby scraping toolkit scRUBYt!, has put together a great article showing the process, from start to finish, of scraping Google results using Ruby “in no seconds”. In reality, it’ll take you at least sixty to read the post.
How to send SMTP mail in Ruby using ActionMailer (outside Rails)
Like most bits of Rails, ActionMailer has an elegant and coder friendly interface. With a bit of set up, it’s remarkably quick and easy to get running from vanilla Ruby outside of Rails.
Recently I’ve needed to bulk email a bunch of files to an internal server for testing purposes. I’ve used ActionMailer inside Rails in [...]
How To pass Ruby Object to JavaScript function
If you want to pass ruby object to javascript function then do the followin steps…
In Ruby Controller Action…
def sample
ruby_variable = “Something”
ruby_variable.to_json
end
In Ruby RJS File
page.call ‘java_script_function_name’, ruby_variable
In JavaScript
function java_script_function_name(java_script_variable){
alert(java_script_variable);
}
java_script_variable comes in the form of array of javascript.
Add comments if anyone wants

