Topic: JS template not rendered by Ruby on Rails on Heroku

I posted my issue on Stack overflow as well: http://stackoverflow.com/questions/1465 … -on-heroku

I deployed my app to a staging app on Heroku. It works 100% fine locally.

http://exposehair-staging.herokuapp.com

I have two controllers that render JS. When I submit a remote form, its invoking the intended action and executing the code within... except it is not rendering a JS template. Database changes within the action are being made, but that is where the app stops. It is happening to both controllers that render JS. Keep in mind that the app works correctly in dev mode locally.

I'm wondering if the issue lies with the configuration of my app to work with Heroku?

Here is my log for the Heroku app:

2013-02-01T20:17:17+00:00 app[web.1]: Started GET "/" for 68.230.151.152 at 2013-02-01 20:17:17 +0000
2013-02-01T20:17:17+00:00 app[web.1]:   Rendered blurbs/_show.html.slim (2.3ms)
2013-02-01T20:17:12+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:10)
2013-02-01T20:17:12+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:10)
2013-02-01T20:17:08+00:00 heroku[web.1]: Starting process with command `bundle exec thin start -R config.ru -e staging -p 23436`
2013-02-01T20:17:15+00:00 app[web.1]: >> Thin web server (v1.5.0 codename Knife)
2013-02-01T20:17:15+00:00 app[web.1]: >> Maximum connections set to 1024
2013-02-01T20:17:15+00:00 app[web.1]: >> Listening on 0.0.0.0:23436, CTRL+C to stop
2013-02-01T20:17:17+00:00 app[web.1]: Completed 200 OK in 232ms (Views: 114.2ms | ActiveRecord: 63.0ms)
2013-02-01T20:17:17+00:00 app[web.1]: Processing by PagesController#index as HTML
2013-02-01T20:17:17+00:00 app[web.1]:   Rendered business_hours/_index.html.slim (24.9ms)
2013-02-01T20:17:17+00:00 app[web.1]:   Rendered pages/index.html.slim within layouts/application (78.4ms)
2013-02-01T20:17:18+00:00 heroku[router]: at=info
 method=GET path=/assets/foundation/orbit/left-arrow-5a8ccc07cfa3eae4292d7c705fc7b0a2.png host=exposehair-staging.herokuapp.com fwd=68.230.151.152 dyno=web.1 queue=0 wait=5ms connect=18ms service=32ms status=200 bytes=522
2013-02-01T20:17:18+00:00 heroku[router]: at=info method=GET path=/assets/foundation/orbit/right-arrow-6fca0c667c001b2352c44c9fb1e55528.png host=exposehair-staging.herokuapp.com fwd=68.230.151.152 dyno=web.1 queue=0 wait=2ms connect=7ms service=7ms status=200 bytes=3242
2013-02-01T20:31:22+00:00 heroku[router]: at=info method=GET path=/assets/application-6cd756f9981b294d6c6bd575ae87f94b.css host=exposehair-staging.herokuapp.com fwd=68.230.151.152 dyno=web.1 queue=0 wait=0ms connect=59ms service=15ms status=304 bytes=0
2013-02-01T20:31:22+00:00 heroku[router]: at=info method=GET path=/assets/orbit_05-c6ea9ca2a7468ee90a6c8bfc87eb607e.jpg host=exposehair-staging.herokuapp.com fwd=68.230.151.152 dyno=web.1 queue=0 wait=0ms connect=0ms service=1ms status=304 bytes=0
2013-02-01T20:31:22+00:00 heroku[router]: at=info method=GET path=/assets/orbit_03-42632d5ec29efd0b5e4c8cae7336e47c.jpg host=exposehair-staging.herokuapp.com fwd=68.230.151.152 dyno=web.1 queue=0 wait=0ms connect=0ms service=1ms status=304 bytes=0
2013-02-01T20:31:22+00:00 heroku[router]: at=info method=GET path=/assets/orbit_02-64cae3654d21289ce3fe325715c395ed.jpg host=exposehair-staging.herokuapp.com fwd=68.230.151.152 dyno=web.1 queue=0 wait=0ms connect=2ms service=3ms status=304 bytes=0
2013-02-01T20:31:29+00:00 heroku[router]: at=info method=POST path=/blurbs/1 host=exposehair-staging.herokuapp.com fwd=68.230.151.152 dyno=web.1 queue=0 wait=0ms connect=7ms service=167ms status=500 bytes=643
2013-02-01T20:31:22+00:00 heroku[router]: at=info method=GET path=/assets/application-ca9f839e91c53f606b8c9344a4a1243e.js host=exposehair-staging.herokuapp.com fwd=68.230.151.152 dyno=web.1 queue=0 wait=0ms connect=0ms service=1ms status=304 bytes=0
2013-02-01T20:31:22+00:00 heroku[router]: at=info method=GET path=/ host=exposehair-staging.herokuapp.com fwd=68.230.151.152 dyno=web.1 queue=0 wait=8ms connect=16ms service=148ms status=200 bytes=30683

And my gemfile

source 'https://rubygems.org'
ruby '1.9.3'

# Gems required by all environments
gem 'jquery-rails'
gem 'rails', '3.2.9'

gem 'acts-as-taggable-on'                     # https://github.com/mbleigh/acts-as-taggable-on
gem 'carrierwave'                             # https://github.com/jnicklas/carrierwave
gem 'combined_time_select', '~> 1.0.0'        # https://github.com/excid3/combined_time_select
gem 'fog', '~> 1.3.1'                         # https://github.com/fog/fog
gem 'font_awesome', '~> 3.0'                  # https://github.com/balexand/font_awesome
gem 'foundation_rails_helper',                 # https://github.com/sgruhier/foundation_rails_helper
  :git => 'git://github.com/sgruhier/foundation_rails_helper.git',
  :branch => 'master'
gem 'mini_magick'                             # https://github.com/probablycorey/mini_magick
gem 'rack-canonical-host'                     # https://github.com/tylerhunt/rack-canonical-host
gem 'redcarpet'                               # https://github.com/vmg/redcarpet
gem 'roboto'                                  # https://github.com/LaunchWare/roboto
gem 'slim-rails'                              # https://github.com/leogalmeida/slim-rails
gem 'sorcery'                                 # https://github.com/NoamB/sorcery
gem 'stamp'                                   # https://github.com/jeremyw/stamp
gem 'validates_email_format_of'               # https://github.com/alexdunae/validates_email_format_of

# Gems requred only for development
group :development, :test do
  gem 'better_errors'                         # https://github.com/charliesome/better_errors
  gem 'binding_of_caller'                     # optional dependancy of better_errors
  gem 'sqlite3'
end

# Gems required for heroku
group :staging, :production do
  gem 'foreman'
  gem 'pg'
  gem 'thin'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'coffee-rails', '~> 3.2.1'
  gem 'sass-rails',   '~> 3.2.3'
  gem 'uglifier', '>= 1.0.3'
  
  gem 'compass-rails'                           # https://github.com/Compass/compass-rails
  gem 'zurb-foundation'                         # http://foundation.zurb.com/docs/
end

I also have the following set in my application.rb file:

config.assets.initialize_on_precompile = false

Thank you.

Learning rails, one day at a time.

http://keilmiller.com

Re: JS template not rendered by Ruby on Rails on Heroku

Anyone? Are all 19 views spam? I'm still stumped on this one and heroku got rid of their support and refers people to stack overflow now.

Learning rails, one day at a time.

http://keilmiller.com

Re: JS template not rendered by Ruby on Rails on Heroku

I'll paypal $10 to anyone who can resolve this issue for me.

Last edited by tuscanidream (2013-02-06 18:27:22)

Learning rails, one day at a time.

http://keilmiller.com

Re: JS template not rendered by Ruby on Rails on Heroku

Video here: https://vimeo.com/59312693

Learning rails, one day at a time.

http://keilmiller.com

Re: JS template not rendered by Ruby on Rails on Heroku

Issue resolved on stack overflow: http://stackoverflow.com/questions/1465 … 4#14804434

I moved coffeescript outside the assets folder, and all was well.

Learning rails, one day at a time.

http://keilmiller.com