I have a problem while developping an application using rails.
I’d like to add some methods to my controller depending upon some
parameters read from an xml file during initialisation (I hope I am
quite clear )
Below is the code I am using:
class MyController < ApplicationController
def index # Xsd is a model (not ActiveRecord that is used to get
values from an XML file
xsd = Xsd.new(“myfile.xsd”)
# Get main section @main_sections = xsd.get_main_sections # Get item for first section @item =
# Dynamically create method for to retrieve list of
fields for each
# THIS PART IS NOT WORKING
@main_sections.each do |section|
While testing this, I have an error message saying that the
define_method does not exist !!!
Why is this method not found ???
I am still not sure about the instance_eval, class_eval, define_method
I need to use.
Do you have any clues regarding this problem ?
Thanks a lot,