• An exciting week for all of us

    photo
    • robert
    • June 13th, 2008
    • 09:18:38 AM

    A lot has happened over the past week on the FP project. Most notably, we started merging the code and html we’ve written with Erin #2’s actual design for the website!

    This is a real excitement for me because I was sick of looking at plain text pages on my localhost server (See screenshots here). Now when I load up the website, it looks all pretty with colors!

    In the words of Allyn and myself, “It’s finally starting to look like a real website.”

    I have been polishing a lot of things in the past week to make sure everything that needs to be completed in this phase will run smoothly. In addition, I added an auto complete field to the site. It turns out creating an auto complete field falls apart in Rails 2.0!

    Reason: ajax requests created by the auto complete field weren’t playing nicely with Rail’s built-in security module.

    Luckily, a little Google search revealed a solution to the problem and all was well in the world… Kind of.

    My next problem was that the auto complete field could only update the value of the text field to which it’s attached. This is usually fine - but the data I was working with required that I store some extra information in a hidden field. Oh well, I guess rails can’t always be perfect.

    *Last edited by Dusty with the comment “Stop posting screenshots, noob.” *

    Comments

    Ian Selby

    You could use a little DOM trickery to get the thing to update the hidden field..

    say your return was a bunch of li elements:
    <li>some value</li>
    <li>some other value</li>

    throw some ID’s in there with the desired value for your hidden element:
    <li id=”123″>some value</li>
    <li id=”456″>some value</li>

    then, when you create your autocomplete object, just add this parameter:
    afterUpdateElement: function(text, li)
    {
    $(’hiddenElement’).value = li.id
    }

    That should square you away… there’s better example on the scriptaculous docs:
    http://github.com/madrobby/scriptaculous/wikis/ajax-autocompleter
    (just before the notes)

    Also, damn you Dusty, I want to see what this thing looks like :)

    Chris

    I’ve been following for awhile and always wondered why you guys choose ruby on rails? Maybe that answer could turn into a blog?

    dusty

    Chris,

    We chose Ruby on Rails because its AWESOME! Really. Actually though, its a great platform for getting up to speed quickly, and for building apps quickly. Ruby is a great language, and though Rails has some things about it that make you angry from time to time, at the end of the day, its a real joy to program for.

    Writing a blog post about this is a great idea though! We’ll start one and go into a bit more depth on why Ruby vs. something else.

    Actually, if you want a bit of an idea, a great starting place for the “Ruby vs ???” is here: http://railsenvy.com/tags/Commercials

    Those guys put together a bunch of great videos highlighting the pluses and minuses of Rails and other platforms :-)

    Dusty

    Chris

    Awesome Dusty. I’ve been looking at trying to learn a language myself so it would be really nice to hear(read) on how you guys came to Ruby.

    Feisty Piranha Project - BrightMix 2008 Summer Internship » Interns can Learn Ruby Fast

    [...] has been pretty awesome week for the ol’ FPP. As Bob already indicated, we’ve been busy implementing Erin #2’s design in with the code and markup. Basically, [...]