undefined method `add_gritter'
webmagnets opened this issue · 5 comments
I have this code in a js.erb file:
$('.old_hint').click(
function () {
<%= add_gritter("This is a notification just for you!") %>
});
I have the gem installed and the following is my application.js:
//= require jquery
//= require jquery_ujs
//= require gritter
//= require bootstrap
//= require_tree .
What could be the problem?
What version of Ruby and Rails are you using? And just to be sure: you have restarted your server after adding the gem to the Gemfile and running bundle install
?
3.2.9
Nathan Cain
501-463-6336
ndcain@gmail.com
On Mon, Jan 7, 2013 at 9:49 AM, Robin Brouwer notifications@github.comwrote:
What version of Ruby and Rails are you using? And just to be sure: you
have restarted your server after adding the gem to the Gemfile and running bundle
install?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/26#issuecomment-11956534.
Haven't tried it on 3.2.9. I'll try it tonight and see if I'm having the same problemn (I'm working at the moment).
Ok. Thanks for your attention.
Nathan Cain
501-463-6336
ndcain@gmail.com
On Mon, Jan 7, 2013 at 9:57 AM, Robin Brouwer notifications@github.comwrote:
Haven't tried it on 3.2.9. I'll try it tonight and see if I'm having the
same problemn (I'm working at the moment).—
Reply to this email directly or view it on GitHubhttps://github.com//issues/26#issuecomment-11956915.
I'm sorry for being a bit late. I was busy last night, so I just checked it out. I created an application myself (rails 3.2.9 and ruby 1.9.2), and created a js.erb file with <%= add_gritter("This is a notification just for you!") %>
in it. I didn't get the error and saw the gritter message. So I don't know what could be causing your issue. Could you answer the following questions?
- You're using it inside a js.erb AJAX view right? Or are you using it inside a JavaScript asset with a .erb extension? If so, that could be the problem. I haven't tested if that works, so I'm not sure if it's possible to use add_gritter that way.
- What version of Ruby are you using?
- Do you have
gem 'gritter'
in your Gemfile? - After adding that line to the Gemfile, did you run
bundle install
and then restart your server?