-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undefined Method short_url #156
Comments
Having the same issue here with the undefined method - is there a trick to getting this to work @jpmcgrath ? Can't seem to get it to work no matter what I try. |
Hi @Talha345 and @mchapman17. I cannot reproduce this issue, trying various combinations of Ruby (2.5.1, 2.7.6, 3.0.1) and Rails (5.2.8, 7.0.7), and following the instructions in the README. It is difficult for me to say why the helper method is not being made available. Can you provide more information, like the ruby/rails versions you are using. Even better, can you please see if you can reproduce this issue in a fresh Rails application, and share the code? |
Yea I'm having the same problem. Can't access those helpers through views, controllers, or models. Anyone figure it out other than the hack? This was my hacky solution:
Then I had to add my own module helper to actually generate the links
Definitely not as elegant as it could be since this is supposed to be built into the gem.
|
Have the same problem ruby(2.4.4) rails(5.2.8) |
I got the same issue for
or
I chose the later because it only affects my mailer, basically you just need to include the helper if the method is missing. I'm using Rails 7.0.8.4. |
Same problem |
Hi,
I am trying to generate a short url using the provided helper method but it gives me a undefined method `short_url' so I had to hack a similar method myself like:
I used the following route:
get '/short_urls/:id' => "shortener/shortened_urls#show"
The text was updated successfully, but these errors were encountered: