passing variable in form

I want to pass a variable task_id to my todo form. How can I pass it without using hidden field?

Vapor .. wrote:

I want to pass a variable task_id to my todo form. How can I pass it without using hidden field?

How are you passing it? If you create the object when you load the page then it is available to the page as it loads. For example, if in your controller method you say something like:

@task_d= Tasks.find( :first, :conditions => ['id = ?', 12345])

Then you can always use that @task_id object to populate a text field, for example:

<input type="text" value = "<%= @task_id %>" />

Can you give us some code so we can see what it is you are trying to do?

-S

Shandy Nantz wrote:

How are you passing it? If you create the object when you load the page then it is available to the page as it loads. For example, if in your controller method you say something like:

@task_d= Tasks.find( :first, :conditions => ['id = ?', 12345])

Actually I am trying to do has_many relation without using REST, so I have to pass the value of parent (task_id) through form.

You don't want to use REST? Do you not want to use your mouth to eat
too?

Using restful routes greatly assists you in stuff like this, please do
use it, it's there for a reason.

Ryan Bigg wrote:

You don't want to use REST? Do you not want to use your mouth to eat too?

Using restful routes greatly assists you in stuff like this, please do use it, it's there for a reason.

oh! you guys are arrogant. all right I am going to use REST!

oh! you guys are arrogant. all right I am going to use REST! --

Maaaaaaaaaam! He used the "a" word!

Believe me, once you use REST you'll wonder how you lived without it.