Sample Rails Application – A demo for the ajax based drag drop tree in rubyonrails

November 26, 2006 at 9:44 am 55 comments

I have provided the source code of the ajax based drag drop tree in rubyonrails in one of my previous posts.
I found some of the people are getting problems to incorporate the code into their running applications so i am providing a sample rails application in which all the code for tree is already been placed well.
However the code written seems to be lagged behind the current trends followed in rails development coz of the fire growth of rails itself, but its simply that when i wrote this tree i was very new to rails so you may find the code looks like an old wine but still tastes good to go with.

CHECK THIS OUT…

Four simple steps to make the tree working…

  1. DOWNLOAD the sample application. (let me know if you are getting any error in downloading the application.)
  2. Create a test database in mysql or modify the file /config/database.yml according to the database and user u need.
  3. Run the command
    ajaxtree> rake db:migrate

    from the application root.

  4. Run the application server by running
    ajaxtree> ruby script/server

    and watch the working tree at http://localhost:3000

Advertisements

Entry filed under: ajax, ajax tree, drag drop tree, ror, Ruby on Rails, rubyonrails, tree.

Javascript Validations and Encryptions — how to use javascript encryptions in rails. Going to BarcampDelhi-2

55 Comments Add your own

  • 1. Sur Max  |  November 26, 2006 at 8:42 pm

    Hello Readers,
    Give me your email as the CONTENT of comment for this post and i will mail you the sample application for the tree.
    ========================================================

    Need not to wait till i mail the application
    I have uploaded the application at Ruby Forge…
    DOWNLOAD the application directly.

    Reply
  • 2. zeno  |  November 26, 2006 at 11:43 pm

    thanks

    Reply
  • 3. Matt  |  November 27, 2006 at 12:12 am

    thanks

    Reply
  • 4. bryan  |  November 27, 2006 at 2:21 am

    Thank you

    Reply
  • 5. Sur Max  |  November 27, 2006 at 3:35 am

    Hi Zeno, Matt, Bryan !!
    I have mailed you the application.
    ====================================================
    Hello Everyone !!
    I request you to add your email as the CONTENT of the comment too apart from providing it into the email field.

    Reply
  • 6. rajeev gupta  |  November 27, 2006 at 5:33 am

    no comments

    Reply
  • 7. Matteo  |  November 27, 2006 at 5:55 pm

    I leave my mail for the sample code! Thanks

    Reply
  • 8. Brian  |  November 28, 2006 at 2:10 am

    Thanks a lot!

    Reply
  • 9. Sur Max  |  November 28, 2006 at 2:14 am

    Hi Brian, Hi Matteo !!
    I have mailed the sample application…

    Reply
  • 10. Scott Becker  |  November 28, 2006 at 3:19 am

    Can you mail me the sample app too please? Thanks!

    Reply
  • 11. Sur Max  |  November 28, 2006 at 4:36 am

    Hi scott !!
    I have mailed the sample application…

    Reply
  • 12. hemant  |  November 28, 2006 at 3:10 pm

    AAP KA DHANYA WAAD CODE BHIJWANE KE LIYE
    Jeete raho Beta
    Bhagwan tumhari umar lambi kare
    JUG-2 JIYO SADA SUHAGAN RAHO
    WAISE TUM LADKI HO NA BETI

    Reply
  • 13. robin  |  November 28, 2006 at 5:56 pm

    robi123@gmail.com

    Reply
  • 14. Sur Max  |  November 28, 2006 at 11:23 pm

    Hi Hemant, Robin !!
    I have mailed the sample application…

    Reply
  • 15. mark  |  November 28, 2006 at 11:35 pm

    pinebrook101@yahoo.com

    Reply
  • 16. Sur Max  |  November 28, 2006 at 11:39 pm

    Hi Mark !!
    I have mailed the sample application…

    Reply
  • 17. gabriel  |  November 29, 2006 at 6:47 pm

    gabriel DOT horner AT gmail DOT com

    Thanks

    Reply
  • 18. Sur Max  |  November 30, 2006 at 3:09 am

    Hi Gabriel !!
    I have mailed the sample application…

    Reply
  • 19. Brian Kassay  |  November 30, 2006 at 7:37 pm

    Thanks! Looking forward to the example!

    brian.kassay@sypris.com

    Reply
  • 20. Sur Max  |  November 30, 2006 at 7:57 pm

    Hi Brian !!
    I have mailed the sample application…

    Reply
  • 21. opa  |  December 1, 2006 at 3:59 pm

    Hello Sur,
    can you mail me your sample app please ?
    opa AT asimage DOT com

    thx 🙂

    Reply
  • 22. Sur Max  |  December 1, 2006 at 5:10 pm

    Hi Opa !!
    I have mailed the sample application…

    Reply
  • 23. Nata  |  December 2, 2006 at 5:56 am

    kaynata76@yahoo.com

    Reply
  • 24. Sur Max  |  December 2, 2006 at 8:30 am

    Hi Nata !!
    I have mailed the sample application…

    Reply
  • 25. charlysquare  |  December 3, 2006 at 12:23 pm

    Hi,

    Here my mail for the content :

    charlysquare@altern.org

    Thanks a lot ;=)

    Reply
  • 26. Dene Egglestone  |  December 3, 2006 at 8:25 pm

    Can you please email the sample application to degglestone@xtra.co.nz. Thanks

    Reply
  • 27. Sur Max  |  December 4, 2006 at 4:53 am

    Hi Charly, Hi Dene !!
    I have mailed the sample application…

    Reply
  • 28. med  |  December 4, 2006 at 9:04 pm

    Thank you !

    Reply
  • 29. Fel  |  December 5, 2006 at 1:16 am

    hanks

    Reply
  • 30. Felipe  |  December 5, 2006 at 1:18 am

    wena wena

    Reply
  • 31. Sur Max  |  December 5, 2006 at 5:22 am

    Hi med, fel, felipe !!
    I have mailed the sample application…

    Reply
  • 32. Van  |  December 5, 2006 at 7:48 am

    Please send me too..
    rozenbom@gmail.com

    Reply
  • 33. Sur Max  |  December 5, 2006 at 7:51 am

    Hi Van !!
    I have mailed the sample application…

    Reply
  • 34. andy  |  December 5, 2006 at 4:44 pm

    mitlenatch@gmail.com

    would love the source code when you get a chance! thanks for all of the hard work!

    cheers,
    andy

    Reply
  • 35. Sur Max  |  December 5, 2006 at 5:42 pm

    Hi Andy !!
    I have mailed the sample application…

    Reply
  • 36. August Lilleaas  |  December 6, 2006 at 8:27 am

    Heya. Kinda tideous having to mail it, isn’t it? There’s tons of free file sharing sites out there. Anyway, please mail it to me =D

    Reply
  • 37. Sur Max  |  December 6, 2006 at 1:11 pm

    Hi August !!
    I have mailed the sample application…

    I agree with you August… I am moving it to RubyForge, although its not that precise code as it has been written far back from now still for the sake of comfort i am moving it there.

    Reply
  • 38. David Littman  |  December 6, 2006 at 1:22 pm

    please mail project to me. thanks.

    Reply
  • 39. Sur Max  |  December 6, 2006 at 1:25 pm

    Hi David !!
    I have mailed the sample application…

    Reply
  • 40. Mark  |  December 6, 2006 at 4:13 pm

    Hi, please send sample code to:

    markmcculley AT gmail DOT com

    Thanks!

    Reply
  • 41. Mike Rood  |  December 6, 2006 at 8:25 pm

    Hi, Sur. This looks great. Please send me the sample app.

    Reply
  • 42. Sur Max  |  December 7, 2006 at 5:42 am

    Hi Mike, Mark, August !!
    I have uploaded the sample application at Ruby Forge..
    DOWNLOAD the application.

    Reply
  • 43. charlysquare  |  December 7, 2006 at 8:01 pm

    Thanks a lot Sur,

    Your code is really good, simple, and really helpful !!

    I’m working on it to add plugins such as listing the content of a “directory”, or adding a menu (right click with the mouse for ex.) to create a new directory, etc…

    If you’ve already worked on these need, just tell me ;=)

    charly

    Reply
  • 44. Sur Max  |  December 8, 2006 at 3:03 am

    Hi charly !!
    I am already working on the plugin of tree with some additional functionalities and will be launched within next week. However it will not be exactly what you are saying but i gues it will be good if you first see that plugin and then implement you functionalities there, so that the plugin will be more enhanced i suppose.
    I will post here and inform u too when the plugin will be launched.

    Thanks.

    Reply
  • 45. charlysquare  |  December 8, 2006 at 9:51 am

    Ok, i’ll wait then !

    Reply
  • 46. Sur Max  |  December 8, 2006 at 10:14 am

    Well, i guess need not to wait.. If your code is modular enough then it will not be difficult to incorporate it later on.. So, i will look forward to see your modifications (in-case if you will be interested to share with me) .

    Thanks.

    Reply
  • 47. charlysquare  |  December 11, 2006 at 11:48 pm

    No problem, i work a few on it, and share ;=)

    Reply
  • 48. charlysquare  |  December 11, 2006 at 11:49 pm

    No problem, i work a few on it, and share ;=)

    I think i will try to add in place editor function, a create function, and a file-browser-like view.

    Notice i’ve said “try to” lol ;=)

    Charly

    Reply
  • 49. tmc  |  December 22, 2006 at 6:00 pm

    Very nice.

    I’m very new to rails; but I like what I see. I got your demo running in a few minutes. The following may be obvious to more experienced users.

    I noticed if an item from the root is dragged under another item, there is no way to put the item back in the root. Perhaps a root icon is needed?

    Is there an easy way to combine this with the scaffold generator so there is CRUD forms integrated into the tree? I’d like to be able to click ADD, EDIT, VIEW, and DELETE and have the appropriate form be displayed to the right of the tree based on the item selected on the tree.

    Finally, can I toggle the drag and drop feature off?

    Reply
  • 50. Sur Max  |  December 22, 2006 at 6:18 pm

    Hi tmc !!

    Well, i just provided the tree with the minimum features, just to show the awesome approach of rails towards the web development to the users who are still stuck to php stuffs and thereby i am giving a sample application for more ease of feeling amazed out of rails and specifically towards implementing ajax.

    Definitely i will love to help for the things which i feel to be helped to a fresher to rails.

    Of-course the thigs what you are asking like .. ADD, EDIT DELETE etc… and switching off the DRAG-DROP are just a kids play if you are fluent enough with rails development. But as you said that you are new to rails so you can take it as a good assignment to furnish your rails, coz even a fresh rails developers can do it within 1-2 days.

    I must suggest you to do all these things yourself make your tree better.

    Reply
  • 51. bjkdlc  |  January 4, 2007 at 8:31 pm

    http://20six.co.uk/ritas/

    Reply
  • 52. Roger  |  January 19, 2007 at 1:44 am

    Hi.

    When I tried to run this, I get an exception (below)]
    when connecting in after a fresh install (have db setup
    etc).

    I’m running Ruby v1.8.4 with Rails 1.1.6

    ————————————————-

    You have a nil object when you didn’t expect it!
    The error occured while evaluating nil.has_parent?

    Extracted source (around line #54):

    51:
    52:
    53:
    54:
    55:
    56:

    Reply
  • 53. Roger  |  January 19, 2007 at 1:45 am

    Sorry, it truncated my exception.
    If you send me e-mail, I can send the entire thing back to you.

    Reply
  • […] ========================================================== I have also incorporated the code into a sample application which you can directly check out and try the tree yourself if you find it a headache to add the following code in a number of described files. So, here is the Sample Tree Application […]

    Reply
  • 55. kermitaner  |  July 29, 2007 at 11:52 am

    hello,

    great code, thx its running perfect.
    But I first had to get the right rails version with: gem install -v=1.1.4 rails –include-dependencies,
    because gem didn’t get through the XP firewall i had to install a new firewall ( ashampoo free version ) and disable the windows firewall ( reboot necessary)
    then rake db:migrate threw an access denied error, so i blanked out the password in the database.yaml file for the test&developement environment … finally got it running 😉

    Reply

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Contact

sur.max(at)gmail.com
November 2006
M T W T F S S
« Oct   Dec »
 12345
6789101112
13141516171819
20212223242526
27282930  

Power Shots

Subscribe


%d bloggers like this: