Hello I am new to ruby and rails (using rails 2). Can some body please
help with the following -
I have a form with a database text field and a series of buttons when a
button is pressed i need a specific string with a time & date stamp
inserting into the on screen text field.
The problem is I don't want the buttons to post the form, I want the
form to stay open so the user can add additional notes to the same
database text field.
When they have finished then they can hit the create button to insert
into the database their completed text.
How should I do this, code examples would be helpful as I am a newbie to
programming with ruby, rails & javascript.
Thanks for helping,
I have looked at the button_to_function help doc and searched google
etc. and because I am a total newbie it dosen't make much sence to me
with regards to the implementation of the javascript side of things.
so I have a few questions I was hoping you could help with..
1. Do I put the javascript in the controller.rb as a 'def' or does it
go in my html.erb file? - do you have a sample source code example
please :)?
2. The ('id_of_your_text_field') - how do I know what my text field id
is, for example I have the following extracted from my html.erb file...
3. I was wondering if the user typed some text in the field and then
clicked the button would the users text be wipped out of the field by
the button action? - that would be a problem.