Comments (6)
Hello @Rockster160 , did you resolved your issue? I have no problem with calling fa_icon helper method. Methods provided by this gem will be accessible only in your views and representers. If you want to call it in models or controllers, you will have to include it manually.
from font_awesome5_rails.
I was calling the methods within views and never got it working. I eventually defined my own helper that generates the html.
It's possible it's related to the fact that the views were in a namespaced file? So instead of
views/users/index
it was in views/v2/users/index
- I don't see why that would cause an issue, but that's the only thing I can see that's different.
from font_awesome5_rails.
No that shouldn't cause any problems. I use this gem in many projects and everything works as expected even in namespaced views. Maybe if you use some gem, that have dependency on older font-awesome gem this could cause problem (but you shouldn't get undefined method).
Try call fa5_icon
instead of fa_icon
in your view and see if it resolve your issue.
from font_awesome5_rails.
fa5_icon
has the same issue. When called from a view, an error is raised:
NoMethodError at /.../...
undefined method `fa5_icon' for #<#<Class:0x00007fcefc01b0f8>:0x00007fcefc02a738>
from font_awesome5_rails.
I noticed this on a mailer template, but given the style requirements for an email it doesn't really make sense to use it there.
from font_awesome5_rails.
Any solutions on this?
undefined method `fa_icon' for #<ActionView::Base:0x000000000112b0>
rails version 6.1.4.1
ruby version 2.7.4p191 (2021-07-07 revision a21a3b7d23)
from font_awesome5_rails.
Related Issues (20)
- Add option to put text to the right of icon HOT 3
- Pro icons not working HOT 5
- Rails 5.2.3 support HOT 1
- Icons not generated properly HOT 4
- name and future of gem HOT 7
- Using Pro HOT 4
- I'm Getting a Missing icon_header Error After Updating to Version 0.7.0 HOT 3
- great work. thank you. HOT 1
- fix blink problem with turbolinks HOT 2
- Prevent Chrome from jumping to the top of the page on remote forms HOT 8
- facebook / twitter icons not working HOT 2
- Is it possible to add a class to each of the stacked icons? HOT 2
- font_awesome5.css not loading in production environment HOT 2
- Apple icon is not able HOT 2
- Missing icons compared to the 'Free' pack HOT 3
- Constants don't load properly in Rails 6.1 HOT 5
- Allow use of icons as inline svg HOT 1
- Font-awesome 6 HOT 1
- Getting 'Cant find stylesheet to import' after new JSBundling Rails 7 install HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from font_awesome5_rails.