I was creating a new app using ZURB Foundation.
There are three controllers. And ih one of them – everything works fine, all css and javascripts includes everytime when i run the server in development. But if i run my Projects#Controller, it gets only plain html, without loading javascripts and css. I tried everything, but still dunno what to do with it.
Here is the logs from the console:
When it works fine
Started GET "/" for 127.0.0.1 at 2013-01-09 21:36:21 +0200
Processing by PagesController#info as HTML
Rendered pages/info.html.erb within layouts/application (0.3ms)
Rendered layouts/_head.html.erb (36.9ms)
User Load (1.6ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
Rendered layouts/_header.html.erb (8.9ms)
Rendered layouts/_flash_messages.html.erb (0.3ms)
Rendered layouts/_footer.html.erb (66.0ms)
Completed 200 OK in 368ms (Views: 365.2ms | ActiveRecord: 1.6ms)
But then if i go to another page from the other controller it loads only plain html from the page
Started GET "/projects/" for 127.0.0.1 at 2013-01-09 21:23:21 +0200
Processing by ProjectsController#index as HTML
User Load (1.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
Project Load (0.5ms) SELECT "projects".* FROM "projects" WHERE "projects"."user_id" = 1 ORDER BY created_at desc
Rendered projects/index.html.erb (30.8ms)
Completed 200 OK in 78ms (Views: 38.4ms | ActiveRecord: 2.7ms)
Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.11'
group :development, :test do
gem 'sqlite3'
gem 'rspec-rails'
gem 'factory_girl_rails'
end
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'compass-rails'
gem 'zurb-foundation'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem 'devise'
gem 'thin'
gem 'best_in_place'
group :test do
gem 'capybara'
gem 'shoulda-matchers'
end
group :production do
gem 'pg'
end
application.html.erb
<!DOCTYPE html>
<html lang="en">
<head>
<%= render 'layouts/head' %>
</head>
<body>
<%= render 'layouts/header' %>
<div class="container-fluid">
<div class="row-fluid">
<div class="span8 offset2">
<%= render 'layouts/flash_messages' %>
<%= yield %>
</div>
</div>
</div>
<div class='row-fluid'>
<%= render 'layouts/footer' %>
</div>
</body>
</html>
And Controllers
class PagesController < ApplicationController
respond_to :html
def info
end
end
class ProjectsController < ActionController::Base
# before_filter :authenticate_user!
def index
@projects = current_user.projects
respond_to do |format|
format.html
end
end
end
Any help or ideas will be greatly appreciated!
You need to change
class ProjectsController < ActionController::Basetoclass ProjectsController < ApplicationController, then it will know where to search the layout.