Topic: Methods Not Being Executed

Hello,

   I created a Controller to hold the methods to be used by some custom views.  I am able to navigate to the views, but for some reason, the methods are not being executed when the views materialize.  While testing, I actually placed the code for one of the methods inside the view as embedded ruby.  But it won't even execute there.  I am able to successfully embed simple things like "1+1" and get "2"; but any reference to a method is being ignored.

   What am I missing, here?

Regards,

Chuck

Last edited by ChuckWesley (2010-06-21 13:51:17)

Re: Methods Not Being Executed

Need to see some code, post the controller and view(s).

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: Methods Not Being Executed

In the Controller, just for testing purposes, I have...

  def dashview1
    print 'Here is dashview1 from method dashview1'   [ I have also experimented with puts instead of print ]
  end

In the View for dashview1 I have...

<h1>Dashboards#dashview1</h1>
<p>Find me in app/views/dashboards/dashview1.html.erb</p>

<p><%= "here is dashview1"%></p>   [this prints out ok]
<p><%= "here is dashview1"%></p>   [this prints out ok]
<br>

<p><%= 1+1%></p>    [this prints 2]

<p><% puts 1+1%></p>   [this prints "puts 1+1]

<p>here is straight html</p>   [this prints ok]

<p><%:method=>'dashview1'%></p>    [this prints :method=>'dashview1'...  but it does not actually execute the method]

Re: Methods Not Being Executed

I solved this.  I introduced an instance variable in the Controller and then called it with <p><% @item%></p> in the view.