When I thought about how to build an API, I started to search for what is the "best way" to do it. I found that exists specifications to build an A...
For further actions, you may consider blocking this person and/or reporting abuse
Hi, I have an error when I run the command "foreman start -f Procfile.dev"
The error message are written below:
D:/CVWO/project/config/routes.rb:5:in
block (2 levels) in <top (required)>': undefined method
jsonapi_resources' for #ActionDispatch::Routing::Mapper:0x... (NoMethodError)Can somebody help me resolve this isssues?
I try look up for solutions on the internet, but there weren't any. I am also green to react-rails.
Did you install the gem jsonapi_resources?
Hi, Really love your post. But please when you wrote this:
This script will load the pack posts.jsx. We have to create that pack in the app/javascript/packs folder:
Where do i fix this code below:
import React from "react";
import ReactDOM from "react-dom";
import App from "components/App";
document.addEventListener("DOMContentLoaded", () => {
ReactDOM.render(
,
document.body.appendChild(document.createElement("div"))
);
});
You wrote
We're going to create the ApiController, to extend the controller from the ActionController::API module of Rails, and also we're going to include the JSONAPI::ActsAsResourceController from JSONAPI::Resources.
class ApiController < ActionController::API
include JSONAPI::ActsAsResourceController
end
Which file does this go in, and what is the path to that file? (am total beginner)
This should be in the controllers folder.
any light on how to fix this error on Rails 6.1:
uninitialized constant ActionController::ForceSSL (NameError)
this happens when I try to spin up the server, after I installed jsonapi
I saw an issue here, but without resolution :( github.com/cerebris/jsonapi-resour...
Hi Thiago! I've just seen the issue. There are other libraries to implement JSON API spec with rails. You can see them here: jsonapi.org/implementations/#serve...
Why use a gem for json instead of using the --api flag when creating the new rails project?
It's because I am building a web application which included an API inside. With the
--api
flag, I lose the initial configuration to render HTML views.I did that instead of having 2 separated applications because I prefer to handle the routes with Rails, and after that, load the correct React application.
I'll finally learn JSON API π Thanks Kattya!