Hi, I just want to know the following: How can I access a virtual attribute defined in a model using a Netzke::Basepack::Form?
I am trying to access the values through overriding this endpoint "endpoint :netzke_submit do |params, this|" After clicked apply and get inside this endpoint I use js_record_data to access the value submited (is this the correct way to access it?, Should I access it through 'params' variable?) I want to do some logic with this virtual attribute.
I tried the following but it doesn't work:
#model
class User < ActiveRecord::Base
attr_accesible *column_names
#my virtual attribute
attr_accessor :virtual_attribute
end
#netzke component
class UsuariosFormCrudUsuarioPassword < Netzke::Basepack::Form
def configure(c)
c.model = "User"
c.record_id = session[:user_id]
c.items = [
{:id => :virtual_attribute, :name => :virtual_attribute, :xtype => :textfield, inputType:'password', :field_label => "Virtual Attribute", :read_only => false}
]
end
endpoint :netzke_submit do |params, this|
super(params, this)
#debugger
end
end
I hope you can help me.
Best regards.