-
Notifications
You must be signed in to change notification settings - Fork 139
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
Assets are not accessible in API-only app #13
Comments
For those wanting to make this work on the API only rails app.
And un comment or add the following to your application.rb |
Thanks for following up! I guess this gem depends on sprockets routing being hooked up. Feel free to PR the documentation if you can think of a way to explain that clearly. |
I left out adding the assets related gems (sass-rails, uglifier, coffee-rails) to my API only Rails app (v5.1.2) & graphiql seems to work fine. 😉 |
@jam35L I need to serve images uploaded using Carrierwave in an API-only app, so I uncommented |
@yasser-sobhy Please clarify which part is not working. Your API only app is not working or you can't access your images? |
The images wasn't working, but it's working now. Thank you
On Jul 31, 2017 7:12 AM, "James Lo" <[email protected]> wrote:
@yasser-sobhy <https://github.com/yasser-sobhy> Please clarify which part
is not working. Your API only app is not working or you can't access your
images?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#13 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFcbhK2aMfi3NLea4tusMIOhUOZ2rJ4rks5sTVQ-gaJpZM4KPn7E>
.
|
References rmosolgo#37: Rails association should be more flexible now. The runtime dependency on `railties` is required for Engine. References rmosolgo#13: Having a runtime dependency on `sprockets-rails` explicitly ensures that sprockets will be available for handling application.{css,js} requests.
@zfhui Did you have your |
Hi. |
The problem was that i've added application.html.haml not to app/views/layouts/ folder. |
Thx @jam35L |
For rails 6 create
|
Just got
and add to
And it works! |
This is based on my experience setting up GraphiQL for a Rails 6 API app See the detailed instructions in: rmosolgo#13 (comment)
This is based on my experience setting up GraphiQL for a Rails 6 API app See the detailed instructions in: rmosolgo/graphiql-rails#13 (comment)
anyone managed to solve this on Rails 7 ?? |
I created a PR for this over a year ago, but has been ignored. The fix is pretty simple. My PR has fallen out of sync with main. The maintainers should fix this ASAP as including Sprockets in Rails 7 does not work and is ill advised. |
If you add GraphiQL Rails to pura Rails API app you will not get it working as assets are not accessible:
I'm pretty sure this is API-only issue, documentation how to make it working should be improved
The text was updated successfully, but these errors were encountered: