New features on

First, A big thanks to all the guys out there for registering and sending invitation to their friends/relatives to try out

SPhred is currently in very early stages, like what other sites say ‘in beta’.

A few things are added on SPhred in the last couple of days:

1) Earlier you first had to create a post and then could add tags to it but now you can add tags while creating a post.

2) Now you can put a face to your name i.e. add a picture. This functionality is available by going to your profile page. The option is given just below “Profile for your name”. You can access your profile page after signing in by clicking on your email address part of ‘Signed in as your email address‘.

3) Page to view users who sphredded an item has been redone and looks much better now (atleast I think so). Have a look by clicking on the number of users who sphreaded an item. Or you can directly go here

4) Search is functional now though currently it only looks for the search term in a Sphred Item’s title or description.

6) Comments look much better now as you can see the picture of people who posted comments.

I would love to hear your feedback or suggestions i.e. what you would like to have on sphred and what you think isn’t working or won’t work.

Once again thank you all for using sphred.

Not binding your selection list to a particular model in Rails

In Rails, we use collection_select helper to display values from a particular model using a drop down but it is generally tied to a particular model, i.e. if we look at the generated html then we see something like

select name="customer[customer_search]" id="customer_customer_search"

What if we want something like:

select name="customer_search" id="customer_search"

Then we can simply use select_tag helper and get the values from our model like this

customers = Customer.find(:all, :order => 'first_name').map{|x| [x.full_name] + []}
select_tag(:customer_search, options_for_select(customers))

If we don’t want to display the values from model and would like to feed in something simple and manually, then

customers = [['text_to_display1', 'value1'], ['text_to_display2', 'value2']]
select_tag(:customer_search, options_for_select(customers))

If text_to_display and its value both are same then we can use something as simple as:

customers = ['wee', 'asdf']
select_tag(:customer_search, options_for_select(customers))