jquery - jeditable and rails 3 -
I'm trying to use jeditable with my Rail 3 application I'd like to edit some fields inline This is working on my client side, but the data has not been updated in my app.
Can you take a look? thank you in advanced!
My view:
& lt; Dt & gt; Overview: & lt; / Dt & gt; & Lt; Dd class = "edit_textfield" id = "& lt;% = @ project.id%>" Name = "overview" & gt; & Lt;% = @ project.overview% & gt; & Lt; / Dd>
My Controller:
def Update Project = Project.find (params [: id]) Overview = params [: value] project.save Render: Text = & gt; Parameter [: value] expiration
my application.js:
$ (". Edit_textfield"). Submit 'OK', indicator: 'Saving ...', tooltip: 'Click to edit ...', lines: 10, method: "put", submit: {ID: $ (this) .attr ('id'), name: $ (this) .attr ('name')}})}};
Thank you for the sccper, it works.
But when I use jeditable for 2 fields in my page and I edit them, only one is saved, the train thinks that the second value is 0
me The problem seems to come from my controller:
def update @project = Project.find (params [: id]) @ project.name = param [: name] @ project. Overview = Counseling [: Overview] @ Project Sweave Response_to dot | Format | Format.js # {rendere: text = & gt; Params [: value]} end end
Do you have any clue?
What is an overview of the project's specialty? Then it should be
@ project.overview = params [: value]
Comments
Post a Comment