Question

I'm a newbie in AngularJS, and I'm trying to build a Rails-Angular web app. I designed the app to have a main layout with header and footer, and nested layouts for each main section of the app. I'm using Angular UI-Router to use nested views but I can't seem to understand how should I structure the router states and what should my controllers respond.

With all the HTML in angular templates, with what should my rails controllers respond? JSON even if I'm not implementing a API like app?

Thanks

Was it helpful?

Solution

You should have something like the following in your controller actions for your rails/angular interactions:

respond_to do |format|
  format.json {render :json => @object.to_json}
end 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top