Parse rails object into Javscript

I currently have a timesheet page which displays a calendar, a search
function that allows a user to search for a project. Once the user has
selected a specified project they press the plus button that creates a
new row in a new table. I've done this using Javascript. I am so close
to finishing this functionality.Forgive me if this sounds stupid, as I
am new to rails. I was wondering is it possible to parse in a rails
object into Javascript, so that when the plus button is selected it then
creates a new row with the data.

Example of some of my code:

   <% @projects.each do |project| %>
      <tr>
        <td><%= project.project_number %></td>
        <td><%= project.project_name %></td>

            <td><%= link_to_function image_tag("icons/add.png"),
"CreateNewRow()" %></td>

                 </tr>

This simply creates a new a table, and list all the projects in my
projects table. A plus icon is linked to CreateNewRow() Javascript
function. I currently have the createNewRow() function working. However
I can't seem to get it to take the data and put it into new created row.
Supplied an image to make it a little bit more clearer.

Attachments:
http://www.ruby-forum.com/attachment/6479/timesheet.png

I currently have a timesheet page which displays a calendar, a search

function that allows a user to search for a project. Once the user has

selected a specified project they press the plus button that creates a

new row in a new table. I’ve done this using Javascript. I am so close

to finishing this functionality.Forgive me if this sounds stupid, as I

am new to rails. I was wondering is it possible to parse in a rails

object into Javascript, so that when the plus button is selected it then

creates a new row with the data.

Example of some of my code:

<% @projects.each do |project| %>

  <tr>

    <td><%= project.project_number %></td>

    <td><%= project.project_name %></td>



        <td><%= link_to_function image_tag("icons/add.png"),

“CreateNewRow(#{project.some_data})” %>

             </tr>

This simply creates a new a table, and list all the projects in my

projects table. A plus icon is linked to CreateNewRow() Javascript

function. I currently have the createNewRow() function working. However

I can’t seem to get it to take the data and put it into new created row.

Supplied an image to make it a little bit more clearer.

Attachments:

http://www.ruby-forum.com/attachment/6479/timesheet.png

Posted via http://www.ruby-forum.com/.

You received this message because you are subscribed to the Google Groups “Ruby on Rails: Talk” group.

To post to this group, send email to rubyonrails-talk@googlegroups.com.

To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.