in Education by
I have a rails application which is api only i am using gem rails-api. Now I am trying to create admin panel on it because we realised later that we do need an admin panel. But i think rails-api doesnt have good support for views. When I try to submit forms it says undefined method protect_against_forgery? maybe because it doesnt supports <%= csrf_meta_tags %> I tried to define manually this method in my controller but no luck. def protect_against_forgery? true end How can i submit the forms without getting this error. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
in your api controller put following line. skip_before_filter :verify_authenticity_token or try with def protect_against_forgery? false end this may be help you.

Related questions

0 votes
    I would like to change the user sign-in behaviour of devise in a way to redirect a user to a ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    Having a nightmare with this one and think i'm going to go crazy. It must be something simple. I ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    I am implementing a design that uses custom styled submit-buttons. They are quite simply light grey buttons ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    been working on some database data calling into a .php file. The php file contains an "Add" button ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    What is the name of Standard API to Submit the Oracle Concurrent Requests from Back end ?...
asked Nov 22, 2020 in Technology by JackTerrance
0 votes
    I am writing an API for an iOS app where the user's login with the Facebook API on iOS. The server ... achieve this kinda setup? Select the correct answer from above options...
asked Feb 3, 2022 in Education by JackTerrance
0 votes
    So I have a file not found problem. I have an engine that works in development mode in the engines test/ ... :Rails::Engine isolate_namespace CcsCms::PublicTheme paths["app/views"]...
asked Apr 7, 2022 in Education by JackTerrance
0 votes
    A few months ago there was a feature in the Rails API documentation that let you visit the a Rails ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I have 2 models: class Annotation include Mongoid::Document belongs_to :event field :desc, type: String end ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 23, 2022 in Education by JackTerrance
0 votes
    While running the server, i am getting the error incompatible library version.Already Nokogiri is installed in ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    Trying to install the RMagick gem is failing with an error about being unable to find ImageMagick libraries, ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 2, 2022 in Education by JackTerrance
0 votes
    Which of the below does the task of binding the parameters passed to the HTTP method to HTTP Header while using ... ? 1. @PathParam 2. @QueryParam 3. @HeaderParam 4. @PathVariable...
asked Jun 24, 2021 in Technology by JackTerrance
0 votes
    I have a field call query_data defined as text in my MySQL database. In my model I defined this ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 21, 2022 in Education by JackTerrance
0 votes
    I have an ASP.Net Core project with a simple form that has two radio buttons. One radio button ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
...