Slides & Code from Rails Internals Tutorial

Posted by on September 21st, 2008.

Better late than never—here are the slides and the code from the The Renegades Guide to Hacking Rails Internals, the RailsConf Europe 2008 Tutorial given by Pradeep Elankumaran & Michael Bleigh.

Click here to download

Sorry about the delay—the files have also been uploaded to the RailsConf Europe website, though we are not sure when that site will be updated.

Share:

Comment on this post (0 comments)


Updates from Lone Star RubyConf 2008

Greetings from blazing hot Austin, TX where Chris, Adam & I are attending Lone Star RubyConf 2008. We gave the Rails Refactoring—Triage, Prevention & Performance tutorial yesterday to about 25 attendees of the conference, which was quite exciting and enjoyable.

Personally, I really like the small regional-conference feel of Lone Star RubyConf. The ambiance is much more laid-back than the two Railsconfs and networking is effortless. It doesn’t hurt that the conference is located in Austin, which is a real foodie heaven (especially barbeque), with a very cool and friendly Ruby/Rails community.

This year, the conference seems to have attracted a good set of speakers—I saw many prominent Rubyists walking the halls, and talking to many of the speakers was quite informative. Matz is here, and we’ve taken to thanking him for Ruby every time we’ve run into him in the hallway, which is honestly the least we could do without feeling like stalkers.

Highly recommended if you’re thinking of attending next year.

Share:

Comment on this post (0 comments)


Railsconf Europe 2008 Updates + Lonestar RubyConf

Posted by on September 3rd, 2008.

Greetings from still sunny Berlin, where Michael & I wrapped up our Hacking Rails Internals talk yesterday. We would love to hear comments from those who attended—we are actively working on getting the slides and demo code to you as soon as possible. Please rate our session if you did attend, so that we can get some constructive feedback.

Today, Chris & Michael will be presenting Hacking the Mid-End : Unobtrusive Scripting & Advanced UI Techniques in Rails. This 45-minute talk will be a discussion of the “Mid-End”—advanced user interface problems that don’t fit the traditional ‘back-end’ and ‘front-end’ categorization. You can find more details on the RailsConf site.

Chris & I will also be flying out today from Berlin to Austin, TX for the Lonestar RubyConf. Along with Adam Bair, we’re giving a 6-hour mid-level training session on refactoring Rails apps. We will be talking about how to effectively rescue horrid codebases, prevent your codebase from turning into a monster and performance issues—we’re quite excited.

While we’re sad to leave Berlin so quickly—we got the chance to checkout some excellent street food in the city. Next time you’re in Berlin, give yourself a break for one night from expensive restaurants and indulge in Doner Kababs and Bratwurst (usually found with a few blocks of your hotel). Highly recommended. We also saw some yellow watermelon, but that’s not much of a story.

Michael will be here in Berlin till the end of the conference on Thursday—please come say hello if you can at either conference!

Share:

Comment on this post (3 comments)


Greetings from Berlin!

Chris, Michael & I are at sunny/rainy Berlin, Germany at Railsconf Europe 2008. This year, the conference is being held at the Maritim proArte Hotel right in the middle of Downtown Berlin. Great food and interesting people around—we’re looking forward to speaking at the conference tomorrow and the day after.

If you’re attending the RailsConf tutorials, come see Michael & I speak tomorrow (Sept. 2, 2008) about hacking and tweaking the Rails internals for your project’s benefits. We have a nice mixup of slides and livecoding sessions ready, and will be running through some hardcore Rails internals material including the Rails class loader and the ever-confusing Routes implementation.

Chris & I will be attending Bratwurst on Rails, so if you would like to meetup, find us there. Bratwurst On Rails

Stay tuned for more coverage of Railsconf Europe and Lonestar RubyConf!

Share:

Comment on this post (3 comments)


Announcing the CrowdSound July 2008 Release

Intridea is proud to announce the July 2008 release of CrowdSound, the social feedback tool that opens up new lines of communication between you and your customers. The social feedback tool allows enterprise websites and social networking sites to gather, organize and respond to suggestions from their customers—for just $10 per month. Because CrowdSound requires only minimal Web developer knowledge to implement, businesses of all sizes can quickly realize the power of interactive, Web-based customer feedback.


The latest release of CrowdSound has many new much-requested features:

* Customize the widget's colors and look and feel
* A hosted website in addition to the widget
* Custom suggestion buckets
* Private suggestions for sensitive topics
* SSL encryption
* iPhone integration
* User-selectable, customizable categories for each suggestion
* Profanity filtering to focus on constructive criticism
* ...and many more!

Using CrowdSound, companies can open a direct line of communications with customers via the Web—transparently gathering their suggestions without forcing them to navigate away from their page. The standards-based, highly customizable tool seamlessly integrates with an enterprise website or social networking site while providing a tailored look-and-feel that reinforces the company brand.

For additional details and to try it out, visit CrowdSound.com

Share:

Comment on this post (2 comments)


crowdsound on TechCrunch

Posted by on May 20th, 2008.

Intridea’s latest product, crowdsound has been featured on TechCrunch. We love showcasing our products to a new audience, so it’s definitely a treat everytime we make it to the front page.

Here’s the link: CrowdSound on TechCrunch

We’re currently hard at work integrating our new features and pay-plans to take us out of public beta. At the same time, our own widget is helping us receive new suggestions effortlessly—these help us polish our existing features till they shine. As such, here’s a status update on some of the most popular suggestions.

You will soon be able to customize your widget top-to-bottom. Here are a few screenshots of widgets built using the new customization interface:

Next, we’re working on custom categories/tags. These would be in the form of an admin-created, user-selectable list of keywords to attach to each suggestion. For all those who requested internationalization—we’re working on it. We are also working on a new search algorithm to improve the existing suggestions shown when posting a new suggestion.

The bottom line is that crowdsound is under very active development. We recommend that you subscribe to this RSS feed if you want to hear about new releases. Thank you for your support!

Share:

Comment on this post (0 comments)


Announcing 'crowdsound' -- Receiving User Feedback Just Got A Lot Easier

Intridea is pleased to announce the official public beta release of crowdsound, a new tool that allows companies and websites to gather, organize and respond to suggestions from their users.


By integrating the crowdsound widget on their website, companies can transparently gather suggestions from users without forcing them to navigate away from their page. Using the widget, users can post new suggestions and also vote and comment on existing suggestions—essentially building a community around the improvement of the company’s product or website.


crowdsound’s detailed admin interface then lets companies respond to each suggestion, opening up previously closed lanes of communication between the company and users. The admin interface also allows companies to manage, organize and integrate suggestions into their workflows quite easily.


crowdsound is currently in public beta. After the beta phase, we will launch reasonably priced, tiered subscriptions plans with exciting new features.

Share:

Comment on this post (5 comments)


Beboist -- Updates and Attention

Posted by on April 3rd, 2008.

Our friends at Bebo have selected our Beboist plugin to be one of their featured Bebo Social API libraries.

This joyous occasion can only be properly acknowledged by the announcement that Beboist has now been moved to Github, a Git repository host where the cool kids play nowadays. We feel that Github’s convenient fork-edit-push code publishing mechanism will only help Beboist grow even quicker to become a prominent solution for working with the Bebo API.

The old SVN repository will still remain up, but all future development will take place on Github.

So, without further ado—here’s the Beboist Github repository:

http://github.com/skyfallsin/beboist/tree/master

You will install this plugin from your RAILS_ROOT directory as such:

git clone git://github.com/skyfallsin/beboist.git vendor/plugins/beboist

Git has a slight learning curve—here are a few resources to help you get started if you have never used it before: SVN to Git Crash Course, Git Tutorial

Intridea’s Public Trac is still up for bug reports.

Share:

Comment on this post (7 comments)


Beboist - A Rails Plugin for the Bebo Social API

Posted by on January 10th, 2008.

UPDATE

Click here for the latest on Beboist


The Beboist plugin provides a Rails interface to the Bebo Social Networking API.

The plugin was designed from the ground-up to be flexible enough to accommodate any changes to the API, while at the same time providing a clean interface that will be familiar to most Rails developers.

Setup

Ensure that the json gem is installed on your system and the Beboist plugin is installed in your vendor/plugins folder:

gem install json
script/plugin install http://svn.intridea.com/svn/public/beboist

Generate your config/bebo.yml file using

script/generate beboist_settings

Fill in your appropriate app settings in config/bebo.yml. Ensure that your app name is right.

Generate the first migration for your users table using:

script/generate beboist_user_migration

Migrate your database using

rake db:migrate

In your application.rb, insert the following filters:

before_filter :reject_unadded_users
before_filter :find_bebo_user

Write your app, and keep an eye on your logs to catch any possible error messages.

API Reference

The methods listed in the Bebo API Documentation are mapped to Ruby classes in the following manner:

users.get_info(uids => "1,2,3", fields => "first_name, last_name")
  # BECOMES
BeboUsers.get_info :uids => [1,2,3], :fields => ["first_name", "last_name"]

Notes

The Beboist plugin uses Bebo’s JSON API, and the ‘json’ gem to directly convert JSON objects to Ruby. It works with Rails 2.0+, but has not been tested on Rails 1.2. Check the README for more details, and file tickets at Intridea’s Public Trac

Share:

Comment on this post (5 comments)


Announcing 'OpenlySociable Micro' - an OpenSocial Widget Ruby Microframework

Posted by on November 9th, 2007.

What is it?:

‘OpenlySociable Micro’ is a clean, simple and concise way of writing OpenSocial widgets. It uses the Camping microframework and Mongrel to allow developers to write self-contained widgets for OpenSocial-enabled websites with none of the overhead of a full-blown Rails application.


Continue reading this post

Share:

Comment on this post (1 comment)


Announcing 'Cards' - A Facebook App

Posted by on November 8th, 2007.

Cards (beta) is a sweet little app that lets you send your already-uploaded Facebook photos or designs submitted by other users as greeting cards through Facebook.

Check it out at: http://apps.facebook.com/greetingcards


Continue reading this post

Share:

Comment on this post (0 comments)


OpenSocial, Buzz and the Tao of Releasing an API

Posted by on November 3rd, 2007.

Michael Arrington announced OpenSocial on TechCrunch two days before its official release. Prior to that, there were whispers everywhere about Google’s new social platform, but not many seemed to know what exactly was about to go down. Needless to say, this is good buzz. Two days before ‘launch’ the overwhelming mood among web developers, especially us who dwell in the realms of social networking, was one of intense (even feverish at some points) anticipation. What unfolded over the next few days, combined with what we observed of Facebook’s API venture, provides us a set of best practices that we can apply to an API release.


Continue reading this post

Share:

Comment on this post (0 comments)


Facebook Apps on Rails - Part 1

Posted by on September 20th, 2007.

At Intridea, we’ve been busy little beavers working on a couple of hush-hush facebook apps. Needless to say, you will be hearing about those quite soon. But first, a little discussion about Rails plugins for the Facebook F8 API is in order.

The most popular Rails plugin for the Facebook API is RFacebook. The core implementation of RFacebook relies a lot on Hpricot and method_missing (covered earlier in this post) to map the XML results from Facebook to Ruby objects.

There are a few goodies in RFacebook: SSH tunnelling, URL rewriting, and a nice debug panel that displays right on the facebook canvas. RFacebook is becoming more and more mature by the day, but unfortunately maturity sometimes does not equal usability or productivity (by Rails standards, of course). My main issue with RFacebook however, is the convoluted MVC design. For example, facebook session calls are made through a fbsession object. However, this object is accessible only within the controllers, and not the models. Moreover, fbsession objects use method_missing to transfer methods not defined in the ruby code over to Facebook, and so there is no concrete mapping between functions and their variables—it makes things like passing partials instead of strings as parameters for session calls in the controller more difficult, and lo and behold, we’re forced to use the ugliness that can only be mentioned as “html-code-in-the-controller”. Small things surely, but we use Rails and Ruby to “increase productivity and happiness”, and any libraries that have the possibility of being heavily used should be written with such things in mind.

A new contender is Facebooker written by Chad Fowler. He outlines the design points (most of which are vehement arguments against RFacebook’s way of doing things), in a very nice post. A quick look at the code (which is all I have done so far, more to come later) suggests that this is really a very concrete API, that maps functions to non-method_missing functions. However, it does have a bit of a learning curve right now and is well below RFacebook in terms of immediate user-friendliness, which is to be expected since it is still under development and has had no public announcement besides that blog post. More details as we move forward..

Running a quick search on ‘rails facebook plugins’ gives me more results today than it did a few weeks ago, so it seems apparent that there are a few more plugins left that I have missed. Along with that, the new release of Facebook’s Data Store will most definitely bring forth atleast a few more new ones.

Share:

Comment on this post (2 comments)


Bending Ruby (Part I) - An User-friendly Hash using method_missing

Posted by on August 7th, 2007.

There’s been a lot of talk about method_missing lately. Let’s do a little example that leverages this freaky but neat little method in our quest to bend Rails to our will. The following code is a handy trick that lets you access key values in a Hash as regular class methods.

class Hash
  def method_missing(method, *params)
    method = method.to_sym
    return self[method] if self.keys.collect(&:to_sym).include?(method)
    super
  end
end

If you have a key called :name, then my_hash[:name] and my_hash.name will now give the same result. If you call some key that doesn’t exist, then the super call tells Object to throw a generic NoMethodError. Neat, no?

P.S. the collect(&:to_sym) shortcut used above actually evaluates to collect{|x| x.to_sym} in Rails. This functionality is not available in Ruby, but it can easily be replicated by overriding the Symbol class, like so:

class Symbol
  def to_proc(*args)
    Proc.new { |*args| args.shift.__send__(self, *args) }
  end
end

Bending Ruby will be a series of posts that will build on one another.

Share:

Comment on this post (1 comment)


Customized page.* methods for Rails' RJS Templates

Posted by on August 6th, 2007.

So you want to clear your live search fields the moment someone clicks on a result. Here’s a little bit of code that will let you do so in your RJS template:

However, suppose you want to use this same live search clearing scheme over multiple controllers. You can either do re-use the above code for each respective controller method, or you can write the following in your RJS views, thereby DRY-ing up your code:

How, oh how ever do I implement this for my app? Well, this works because in Ruby, it’s quite easy to add or override methods to any class or module. So let’s hack into ActionView, which is the part of Rails that gives you all those neat-o functions in your views (for example: the much-loved link_to).

The trick to overriding Rails code is to always have a copy of Edge Rails checked out to refer to, so you can get the namespace right. For this example, we have established that we want to extend the page.* methods that are prevalent through RJS templates and “render :update” calls. First we need to find out where the code lives. Let’s run a text search on our edge rails copy for ‘insert_html’, which is a commonly used RJS method. We then find out that it’s at action_pack/lib/action_view/helpers/prototype_helper.rb. Well, this is a start!

Next, we look at the namespace of the code in prototype_helper.rb, and try to find insert_html. We then see that it’s nested like so:

Now, in lib/actionview_hacks.rb, copy this namespace and replace the insert_html method with a method of your choice:

Next, update your environment.rb file by adding this somewhere:

That’s it! You can now call page.clear_my_live_search from any RJS template or render :update method. You can also use update_page_tag to insert the page. methods we just generated into your views as javascript.

Also, this example is quite basic. Some might call it overkill to override Rails helpers to get this running. Another good way of doing the same is to define a new method in one of your helpers that uses update_page, like so:

You can then use this helper all over the place, too.

This article barely touches the surface of what’s possible when extending Rails—most existing Rails plugins probably got their start by practically the same process as what we followed here.

Share:

Comment on this post (2 comments)