SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jul 2007
    0 Post(s)
    0 Thread(s)

    using .rjs files?

    I have a form that calls the method add_airline_table. I would like a <span> with the appriate id to highlight when a certain action is performed, by using a .rjs file. To make and use this .rjs file all I have to do is give it the same name as the action being performed, in this case add_airline_table, correct? It is also my understanding that I don't have to add anyhting to the controller or the view? Just been playing with this as well, and its not working, arg! So goes my typical Monday. Any help would be great, thanks all,


  2. #2
    SitePoint Addict
    Join Date
    Jan 2006
    0 Post(s)
    0 Thread(s)
    If you have
    and add_airline_table.rjs

    It will not like, as rails renders the first file it finds. add_airline_table.rhtml comes first, alphabetically, and gets rendered first.

    You can use
      render :partial => 'add_airline_table.rjs'
      #I _think_ it is :partial, but not positive
    If you give someone a program,
    you will frustrate them for a day;
    if you teach them how to program,
    you will frustrate them for a lifetime.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts