In_place_edit_field HELP

Ok I am on rails 2.1

My show view does not have a"for_for" but the controller has
@nocpage = Nocpage.find(params[:id])

and the view for section i am trying to use:

<%=h @nocpage.companyname %>

I tried doing:
<% @name = @nocpage.companyname %>
<%= in_place_editor_field ‘name’, :companyname %>

but I keep getting:

undefined method `companyname’ for “att”:String. Why does it keep
saying undefined method?

On 7 Sep 2008, at 16:30, Me wrote:

I tried doing:
<% @name = @nocpage.companyname %>
<%= in_place_editor_field ‘name’, :companyname %>

I suspect you mean

in_place_editor_field ‘nocpage’, ‘companyname’

the first parameter should be the name of an instance variable, the
second the name of a method on that object (the one that corresponds
to the property to edit)


Thanks. The show page works but I am not getting an edit box to pop
up. I see this with a view source:



On Sep 7, 12:23 pm, Frederick C. [email protected]

DOH. Never mind. Forgot the javsacript include tag. I started this
last night on a different computer.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs