Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Finally, a solution to my number one complaint with Rails:
    http://www.ujs4rails.com/
    This plugin lets you apply Javascript behaviors after the fact and keeps your XHTML Javascript-free! I haven't actually used it yet, though I will be over the next couple of days. All things considered, though, it looks awesome.

    Have a look at the Quickstart guide to get an idea of how this works.

  2.  

  3. #2
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Just tried this out, it's *kind of awesome* :-)

  4. #3
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    Don't forget that while Rails has Javascript helpers it doens't inhibit you from outputting vanilla HTML and baking in your own unobtrusive scripting.

    I'm not a big fan of the JS helpers (I actually think they're utter crap).
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  5. #4
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Oh yes, I'm well aware of this. However, I rather like the idea of being able to apply behavior as mentioned above, and it really does work very nicely.

    In general, I'm not a big fan of the JS helpers, either, but when you can do something like:
    Code:
    apply_behaviour '#my_form', make_remote_form
    It's just... Kind of shiny :-) Not to mention being able to say:
    Code:
    apply_behaviour 'a.remote', make_remote_link
    Rails's default JS helpers are automatically made unobtrusive with UJS, too, which is also really cool.

    Anyway, with respect to the whole issue of liking vanilla Javascript, Dan Webb created an `RJS Minus R' plugin that makes RJS files behave more like RHTML files -- i.e., they act like JS files with embedded Ruby instead of Ruby with embedded JS strings. It looks pretty nice, though I haven't had a chance to try it yet.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:01 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2022 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com