Rails, "undefined method `variant' for nil:NilClass" on render json - ruby-on-rails

I am trying to do something really simple, render a json with some stuff.
I do have a view views/api/initialize.html.erb if this counts as useful info.
I have no idea what causes this but the variables filled alright, I checked
My controller:
class ApiController < ApplicationController
def initialize
#articles = Article.all
#areas = Area.all
#languages = Language.all
data_json = { articles: #articles, areas: #areas, languages: #languages }
render json: data_json
end
def index
end
end
My route:
get '/init', controller: 'api', action: 'initialize'
Here is my full error trace from development.log:
NoMethodError (undefined method `variant' for nil:NilClass):
app/controllers/api_controller.rb:9:in `initialize'
Rendering /usr/local/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.rc1/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout
Rendering /usr/local/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.rc1/lib/action_dispatch/middleware/templates/rescues/_source.html.erb
Rendered /usr/local/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.rc1/lib/action_dispatch/middleware/templates/rescues/_source.html.erb (3.9ms)
Rendering /usr/local/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.rc1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
Rendered /usr/local/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.rc1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.0ms)
Rendering /usr/local/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.rc1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb
Rendered /usr/local/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.rc1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (14.1ms)
Rendered /usr/local/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.rc1/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (44.1ms)
DEPRECATION WARNING: Accessing mime types via constants is deprecated. Please change `Mime::HTML` to `Mime[:html]`. (called from const_missing at /usr/local/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.rc1/lib/action_dispatch/http/mime_type.rb:52)
Rendering /usr/local/lib/ruby/gems/2.3.0/gems/web-console-2.3.0/lib/web_console/templates/index.html.erb
Rendered /usr/local/lib/ruby/gems/2.3.0/gems/web-console-2.3.0/lib/web_console/templates/_markup.html.erb (0.4ms)
Rendering /usr/local/lib/ruby/gems/2.3.0/gems/web-console-2.3.0/lib/web_console/templates/console.js.erb within layouts/javascript
Rendering /usr/local/lib/ruby/gems/2.3.0/gems/web-console-2.3.0/lib/web_console/templates/_inner_console_markup.html.erb within layouts/inlined_string
Rendered /usr/local/lib/ruby/gems/2.3.0/gems/web-console-2.3.0/lib/web_console/templates/_inner_console_markup.html.erb within layouts/inlined_string (0.4ms)
Rendering /usr/local/lib/ruby/gems/2.3.0/gems/web-console-2.3.0/lib/web_console/templates/_prompt_box_markup.html.erb within layouts/inlined_string
Rendered /usr/local/lib/ruby/gems/2.3.0/gems/web-console-2.3.0/lib/web_console/templates/_prompt_box_markup.html.erb within layouts/inlined_string (0.3ms)
Rendering /usr/local/lib/ruby/gems/2.3.0/gems/web-console-2.3.0/lib/web_console/templates/style.css.erb within layouts/inlined_string
Rendered /usr/local/lib/ruby/gems/2.3.0/gems/web-console-2.3.0/lib/web_console/templates/style.css.erb within layouts/inlined_string (0.4ms)
DEPRECATION WARNING: Accessing mime types via constants is deprecated. Please change `Mime::WEB_CONSOLE_V2` to `Mime[:web_console_v2]`. (called from const_missing at /usr/local/lib/ruby/gems/2.3.0/gems/actionpack-5.0.0.rc1/lib/action_dispatch/http/mime_type.rb:52)
Rendered /usr/local/lib/ruby/gems/2.3.0/gems/web-console-2.3.0/lib/web_console/templates/console.js.erb within layouts/javascript (36.5ms)
Rendering /usr/local/lib/ruby/gems/2.3.0/gems/web-console-2.3.0/lib/web_console/templates/main.js.erb within layouts/javascript
Rendered /usr/local/lib/ruby/gems/2.3.0/gems/web-console-2.3.0/lib/web_console/templates/main.js.erb within layouts/javascript (0.4ms)
Rendering /usr/local/lib/ruby/gems/2.3.0/gems/web-console-2.3.0/lib/web_console/templates/error_page.js.erb within layouts/javascript
Rendered /usr/local/lib/ruby/gems/2.3.0/gems/web-console-2.3.0/lib/web_console/templates/error_page.js.erb within layouts/javascript (0.4ms)
Rendered /usr/local/lib/ruby/gems/2.3.0/gems/web-console-2.3.0/lib/web_console/templates/index.html.erb (59.3ms)
Can you locate where the problem is here?
Thank you.

Initailize probably reserved already by Ruby. Just change something not reserved names like test_api_initialize or better api_init.
def api_inits
end
routes:
get '/init' => 'api#api_inits', as: :init

Related

NoMethodError (undefined method `fetch_value' for nil:NilClass) in RAILS

Table Name in SQL : road_ratings
Route:
get '/roadRatings', to: "road_ratings#index"
Controller: road_ratings_controller.rb
class RoadRatingsController < ApplicationController
def index
#data = RoadRating.all
render json: #data
end
end
Model: road_rating.rb
class RoadRating < ActiveRecord::Base
end
Upon running the above API, I get the error in rails server logs
NoMethodError (undefined method `fetch_value' for nil:NilClass):
And following error on browser
NoMethodError in RoadRatingsController#index
However when I run the query SELECTroad_ratings.* FROMroad_ratingsLIMIT 1 generated in rails logs on SQL, I get the correct result
Rails Logs:
Started GET "/roadRatings" for ::1 at 2016-10-04 23:55:57 -0400
Processing by RoadRatingsController#index as HTML
RoadRating Load (0.4ms) SELECT `road_ratings`.* FROM `road_ratings` LIMIT 1
Completed 500 Internal Server Error in 2ms (ActiveRecord: 0.4ms)
NoMethodError (undefined method `fetch_value' for nil:NilClass):
app/controllers/road_ratings_controller.rb:4:in `index'
Rendered /Library/Ruby/Gems/2.0.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_source.erb (5.6ms)
Rendered /Library/Ruby/Gems/2.0.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.4ms)
Rendered /Library/Ruby/Gems/2.0.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.1ms)
Rendered /Library/Ruby/Gems/2.0.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (23.1ms)
Rendered /Library/Ruby/Gems/2.0.0/gems/web-console-2.3.0/lib/web_console/templates/_markup.html.erb (0.8ms)
Rendered /Library/Ruby/Gems/2.0.0/gems/web-console-2.3.0/lib/web_console/templates/_inner_console_markup.html.erb within layouts/inlined_string (0.3ms)
Rendered /Library/Ruby/Gems/2.0.0/gems/web-console-2.3.0/lib/web_console/templates/_prompt_box_markup.html.erb within layouts/inlined_string (0.3ms)
Rendered /Library/Ruby/Gems/2.0.0/gems/web-console-2.3.0/lib/web_console/templates/style.css.erb within layouts/inlined_string (0.4ms)
Rendered /Library/Ruby/Gems/2.0.0/gems/web-console-2.3.0/lib/web_console/templates/console.js.erb within layouts/javascript (16.7ms)
Rendered /Library/Ruby/Gems/2.0.0/gems/web-console-2.3.0/lib/web_console/templates/main.js.erb within layouts/javascript (0.3ms)
Rendered /Library/Ruby/Gems/2.0.0/gems/web-console-2.3.0/lib/web_console/templates/error_page.js.erb within layouts/javascript (0.7ms)
Rendered /Library/Ruby/Gems/2.0.0/gems/web-console-2.3.0/lib/web_console/templates/index.html.erb (39.4ms)
Rake Routes:
Kartiks-MacBook-Air:Mayor_project kartik$ rake routes
Prefix Verb URI Pattern Controller#Action
GET / home#default
streets GET /streets(.:format) streets#index
GET /street/:id(.:format) streets#show
potholes GET /potholes(.:format) potholes#index
roadRatings GET /roadRatings(.:format) road_ratings#index

Component rendering with React in Rails not working

Decided to learn React+Rails. I want to render a simple component that looks like this:
app.js
var App = React.createClass({
render: function() {
return (
<div>
Hello React first component.
</div>
);
}
});
ReactDOM.render(
<App />,
document.getElementById('content')
);
react_controller.rb
class ReactController < ApplicationController
def index
render component: 'App'
end
end
view/react/index.html.erb
<%= react_component 'App' %>
I believe this is enough to show text on my screen. I'm getting:
routes.rb
Rails.application.routes.draw do
root 'react#index'
end
And I'm using the react-rails gem.
From the server (local) I get (apparently there's a syntax error somewhere):
Started GET "/" for ::1 at 2016-07-15 07:06:30 +0200
Processing by ReactController#index as HTML
Completed 500 Internal Server Error in 439ms (ActiveRecord: 0.0ms)
ExecJS::RuntimeError (/private/var/folders/86/mvj6bh4j2k94f52_s9xflmf00000gn/T/execjs20160715-4782-pustjs:22203
<div>
^
SyntaxError: Unexpected token <
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:511:25)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:456:32)
at tryModuleLoad (module.js:415:12)
at Function.Module._load (module.js:407:3)
at Function.Module.runMain (module.js:575:10)
at startup (node.js:159:18)
at node.js:444:3
):
app/controllers/react_controller.rb:3:in `index'
Rendered /Users/siaw/.rvm/gems/ruby-2.3.1#global/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_source.erb (5.1ms)
Rendered /Users/siaw/.rvm/gems/ruby-2.3.1#global/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (5.0ms)
Rendered /Users/siaw/.rvm/gems/ruby-2.3.1#global/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.8ms)
Rendered /Users/siaw/.rvm/gems/ruby-2.3.1#global/gems/actionpack-4.2.6/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (73.6ms)
Rendered /Users/siaw/.rvm/gems/ruby-2.3.1/gems/web-console-2.3.0/lib/web_console/templates/_markup.html.erb (1.3ms)
Rendered /Users/siaw/.rvm/gems/ruby-2.3.1/gems/web-console-2.3.0/lib/web_console/templates/_inner_console_markup.html.erb within layouts/inlined_string (1.1ms)
Rendered /Users/siaw/.rvm/gems/ruby-2.3.1/gems/web-console-2.3.0/lib/web_console/templates/_prompt_box_markup.html.erb within layouts/inlined_string (0.9ms)
Rendered /Users/siaw/.rvm/gems/ruby-2.3.1/gems/web-console-2.3.0/lib/web_console/templates/style.css.erb within layouts/inlined_string (0.4ms)
Rendered /Users/siaw/.rvm/gems/ruby-2.3.1/gems/web-console-2.3.0/lib/web_console/templates/console.js.erb within layouts/javascript (64.8ms)
Rendered /Users/siaw/.rvm/gems/ruby-2.3.1/gems/web-console-2.3.0/lib/web_console/templates/main.js.erb within layouts/javascript (0.4ms)
Rendered /Users/siaw/.rvm/gems/ruby-2.3.1/gems/web-console-2.3.0/lib/web_console/templates/error_page.js.erb within layouts/javascript (0.4ms)
Rendered /Users/siaw/.rvm/gems/ruby-2.3.1/gems/web-console-2.3.0/lib/web_console/templates/index.html.erb (144.0ms)
Try renaming app.js to app.jsx. Also, no need to manually mount component and use react_component at the same time.

How do I debug what takes a partial to render so long in rails?

Rendered cars/_handover_instruction_fields.html.slim (5.5ms)
Rendered cars/_handover_instruction_fields.html.slim (0.6ms)
Rendered cars/_handover_instruction_fields.html.slim (0.5ms)
Rendered cars/_handover_instruction_fields.html.slim (0.5ms)
Rendered cars/_handover_instruction_fields.html.slim (0.5ms)
Rendered cars/_handover_instruction_fields.html.slim (0.5ms)
Rendered cars/_edit_handover.html.slim (30.7ms)
Rendered cars/_edit_vrd.html.slim (5.2ms)
Rendered cars/_edit_features.html.slim (3.5ms)
Rendered cars/_edit_description.html.slim (5.2ms)
CarPhoto Load (0.5ms) SELECT "car_photos".* FROM "car_photos" WHERE "car_photos"."car_id" = $1 [["car_id", 19]]
Rendered cars/_photo_fields.html.slim (217.0ms)
Rendered cars/_photo_fields.html.slim (1.5ms)
Rendered cars/_photo_fields.html.slim (1.1ms)
Rendered cars/_photo_fields.html.slim (1.1ms)
Rendered cars/_photo_fields.html.slim (1.1ms)
Rendered cars/_photo_fields.html.slim (1.0ms)
Rendered cars/_photo_fields.html.slim (1.1ms)
Rendered cars/_photo_fields.html.slim (1.0ms)
Rendered cars/_edit_photos.html.slim (254.6ms)
Rendered cars/_edit_js.html.erb (0.5ms)
Rendered cars/edit.html.slim within layouts/application (356.7ms)
Rendered shared/_flash.html.slim (5.5ms)
Rendered shared/_slideout_nav.html.slim (16.9ms)
Rendered svgs/_carshare_typeface_blue_small.html (0.8ms)
Rendered shared/_header_nav.html.slim (20.1ms)
Above is an excerpt of the Rails.logger when I render one of the pages in my webapp. I realised some of the partial takes suspciously long to render.
For example
Rendered cars/_photo_fields.html.slim (217.0ms)
Rendered cars/_photo_fields.html.slim (1.5ms)
I want to find out what makes the rendering so long and how i can improve it.
<% benchmark("Showing projects partial") do %>
<%= render #projects %>
<% end %>
looks interesting.
A tip in general, if you have many #items don't call render each time. This saves you time.
#items.each do |item|
render 'one_item', :item => item
end
Instead render one time with a collection for example.
Check your logs and it will show you the database queries being generated. This is usually the first place to look and it will highlight where you can make performance improvements by optimising your queries. The obvious one is to check if you can benefit from N + 1 queries using includes.
There are other steps you can take as well, such as adding indices, using pluck if you only need to get individual attributes, using LIMIT and avoid sorting.

SyntaxError in ArticlesController#create on Ruby on Rails

i'm having some trouble with this code. Actually is pretty simple, but i can't find the problem. The page was working yesterday, but now throws me an
" SyntaxError in ArticlesController#new"
and
"/home/peyu/workspace/blog01/app/controllers/articles_controller.rb:30: syntax error, unexpected keyword_end, expecting end-of-input"
I think i'm missing an "end" or something, but i can't find it. Here's the code
class ArticlesController < ApplicationController
def index
#articles = Article.all
end
def show
#article = Article.find(params[:id])
end
def new
#article = Article.new
end
def create
#article = Article.new(article_params)
if #article.save
redirect_to #article
else
render 'new'
end
end
private
def article_params
params.require(:article).permit(:title, :text)
end
end
So... any idea where's my mistake? Thank you in advance!
And this is the console output:
Started GET "/articles/new" for 127.0.0.1 at 2015-05-10 06:34:10 -0300
ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
/home/peyu/workspace/blog01/app/controllers/articles_controller.rb:22: warning: else without rescue is useless
SyntaxError (/home/peyu/workspace/blog01/app/controllers/articles_controller.rb:30: syntax error, unexpected keyword_end, expecting end-of-input):
app/controllers/articles_controller.rb:30: syntax error, unexpected keyword_end, expecting end-of-input
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/rescues/_source.erb (4.8ms)
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.2ms)
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (10.6ms)
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (31.6ms)
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/web-console-2.1.2/lib/web_console/templates/_markup.html.erb (0.6ms)
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/web-console-2.1.2/lib/web_console/templates/style.css.erb within layouts/inlined_string (0.4ms)
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/web-console-2.1.2/lib/web_console/templates/_inner_console_markup.html.erb within layouts/inlined_string (0.3ms)
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/web-console-2.1.2/lib/web_console/templates/_prompt_box_markup.html.erb within layouts/inlined_string (0.3ms)
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/web-console-2.1.2/lib/web_console/templates/console.js.erb within layouts/javascript (15.3ms)
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/web-console-2.1.2/lib/web_console/templates/main.js.erb within layouts/javascript (0.4ms)
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/web-console-2.1.2/lib/web_console/templates/error_page.js.erb within layouts/javascript (0.6ms)
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/web-console-2.1.2/lib/web_console/templates/index.html.erb (34.2ms)
Started GET "/articles/new" for 127.0.0.1 at 2015-05-10 06:34:10 -0300
/home/peyu/workspace/blog01/app/controllers/articles_controller.rb:22: warning: else without rescue is useless
SyntaxError (/home/peyu/workspace/blog01/app/controllers/articles_controller.rb:30: syntax error, unexpected keyword_end, expecting end-of-input):
app/controllers/articles_controller.rb:30: syntax error, unexpected keyword_end, expecting end-of-input
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/rescues/_source.erb (4.6ms)
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (2.2ms)
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (1.4ms)
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/actionpack-4.2.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (21.1ms)
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/web-console-2.1.2/lib/web_console/templates/_markup.html.erb (1.1ms)
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/web-console-2.1.2/lib/web_console/templates/style.css.erb within layouts/inlined_string (0.4ms)
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/web-console-2.1.2/lib/web_console/templates/_inner_console_markup.html.erb within layouts/inlined_string (0.3ms)
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/web-console-2.1.2/lib/web_console/templates/_prompt_box_markup.html.erb within layouts/inlined_string (0.3ms)
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/web-console-2.1.2/lib/web_console/templates/console.js.erb within layouts/javascript (15.7ms)
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/web-console-2.1.2/lib/web_console/templates/main.js.erb within layouts/javascript (0.3ms)
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/web-console-2.1.2/lib/web_console/templates/error_page.js.erb within layouts/javascript (0.4ms)
Rendered /home/peyu/.rvm/gems/ruby-2.2.1/gems/web-console-2.1.2/lib/web_console/templates/index.html.erb (31.9ms)
You can validate your Ruby file like so
ruby -c articles_controller.rb
I tried it and it is ok. Can you copy & paste the exact file content from the articles_controller.rb please? And which Ruby version are you using?
fyi, the private keyword does not require an end, so the correct indenting should be
private
def article_params
params.require(:article).permit(:title, :text)
end
other than that, the code looks ok. Did you check the code for the template? (probably something like new.html.erb)?

Undefined method `each' for nil:NilClass in a partial

I am trying to display a collection as a partial ( on a side panel). I get an error above, have been fighting for several hours and do not understand what is the problem.
Containing view (a partial template included into application.html.haml file):
%span.span12
%ul.nav.nav-pills.nav-stacked{style: "color: white;"}
= render :partial => 'categories/categories_list'
Partial /categories/_category_list.html.haml:
%ul
- #categories.each do |category|
%li{style: "color: white;"}=category.name
Controller (categories_controller):
class Macro::CategoriesController < ApplicationController
def categories_list
#categories= Category.all
end
end
I have separately tried to add "collection: #categories" as an option for render :partial - to non avail. When I replaced the instance variable with just an array in order to test the partial rendering, it worked ( the list items got rendered). Seem like the variable #categories does not get instantiated, however I have double-checked in console that a given activerecord query returns a set of objects. I am breaking my brain to see where I made a mistake.
Log:
Started GET "/ios/macro/namespace2/another" for 127.0.0.1 at 2014-02-11 11:41:23 +0100
Processing by Macro::Namespace2::AnotherController#index as HTML
Parameters: {"param1"=>"xx"}
....... (SQL queries for that view)
Rendered macro/namespace2/another_controller/_another_view.html.haml (7.0ms)
Rendered macro/namespace2/another_controller/index.html.haml within layouts/application (29.6ms)
Rendered layouts/_logout_link.html.haml (0.5ms)
Rendered layouts/_top_navigation.html.haml (3.3ms)
Rendered layouts/_search.html.haml (0.8ms)
Rendered macro/categories/_categories_list.html.haml (0.8ms)
Rendered macro/_navigation.html.haml (3.6ms)
Completed 500 Internal Server Error in 49ms
ActionView::Template::Error (undefined method `each' for nil:NilClass):
1: %ul
2: - #categories.each do |category|
3: %li{style: "color: white;"}=category
app/views/macro/categories/_categories_list.html.haml:2:in `_app_views_macro_categories__categories_list_html_haml__246519878332953677_70248836672780'
app/views/macro/_navigation.html.haml:11:in `_app_views_macro__navigation_html_haml__3071184578230019020_70248793690940'
app/views/layouts/application.html.haml:24:in `_app_views_layouts_application_html_haml__3208937943371424843_70248793607300'
Rendered /Users/me/.rvm/gems/ruby-2.0.0-p353/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.1ms)
Rendered /Users/me/.rvm/gems/ruby-2.0.0-p353/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.8ms)
Rendered /Users/me/.rvm/gems/ruby-2.0.0-p353/gems/actionpack-4.0.0/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (10.6ms)
Routes:
namespace "macro" do
namespace "namespace2" do
resources :another, only: [:index]
end
resources :categories
end
end
Probably the #categories_list action in Macro::CategoriesController is not being called. Check the log and see which controller and action is handling the request.
You should see something like:
'Processing by Macro::CategoriesController#categories_list as HTML'
'Parameters: { }'

Resources