I have this.
Where can i find config/routes.rb
and how to use ApplicationController
in Rhomobile?
How to add a view to existing rhomobile controller?
Is it possible?
config/routes.rb doesn't exist in Rhomobile. If i'm not wrong, then it's present in rails.
Secondly "application.rb" works similar to "ApplicationController" in Rhomobile.
And if in case you want to add new view to existing model, just add new method(def) into the controller(.rb), and new view(.erb) with the same name as of the new method.
let say there exist a model DemoController.rb in app/Demo. you can add new method to it as like
class DemoController < Rho::RhoController
...
def index
end
def new_method
end
end
To navigate from the index view to the new_method, you can write
<button onclick="location.href='/app/Demo/new_method'">new method</button>
or
<button onclick="location.href='<%= url_for :action => :new_method %>'"
>new method</button>