undefined method `params_for_resource'Ruby/Rails: How do you customize the mailer templates of Devise?Devise within namespaceProblems with “devise_for”, “devise_scope”!No Method error : Login attempts using cookies in Rails DeviseHow to have two devise authentication models/routes for Active Admin namespaceshow to disable automatic sign-in after sign-up in DeviseDevise undefined method `user_changed?'Using strong parameters with Devise multiple modelsRails devise with devise_token_auth is not showing the login formUsing devise for user registration/login redirect user to a different form page based on their response

Are there any cons in using rounded corners for bar graphs?

"Mouth-breathing" as slang for stupidity

Illustrator - SVG make thinner path

Number in overlapping range

A+ rating still unsecure by Google Chrome's opinion

What is the farthest a camera can see?

Why does this Jet Provost strikemaster have a textured leading edge?

Stop email from sending using AMPscript

List, map function based on a condition

Where is attribute form widget saved

What is the opposite of "hunger level"?

Unconventional examples of mathematical modelling

Why does Japan use the same type of AC power outlet as the US?

Simulation optimisation: Monte carlo simulation, regression, optimise within regression model?

What modifiers are added to the attack and damage rolls of this unique longbow from Waterdeep: Dragon Heist?

Lípínguapua dopo Pêpê

Are there really no countries that protect Freedom of Speech as the United States does?

What is the most difficult concept to grasp in Calculus 1?

onomatopoeia for cluelessness

Word for an event that will likely never happen again

Locked room poison mystery!

The more + the + comparative degree

Weird resistor with dots around it

Do I have to cite common CS algorithms?



undefined method `params_for_resource'


Ruby/Rails: How do you customize the mailer templates of Devise?Devise within namespaceProblems with “devise_for”, “devise_scope”!No Method error : Login attempts using cookies in Rails DeviseHow to have two devise authentication models/routes for Active Admin namespaceshow to disable automatic sign-in after sign-up in DeviseDevise undefined method `user_changed?'Using strong parameters with Devise multiple modelsRails devise with devise_token_auth is not showing the login formUsing devise for user registration/login redirect user to a different form page based on their response






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am using devise token auth gem to login and signup in a rails 5 Api and I am extending the same Api to be able to use ActiveAdmin to create an admin dashboard up and working which uses Devise to authenticate admin users. Inclusion of all the middlewares and config is done and also changed application controller to inherit from ActionController::Base and made an api_controller that inherits from ActionController::API.
Routes are set too..
But since I am using Overrides/registrations and sessions controller I changed them to inherit from class SessionsController < DeviseTokenAuth::ApiController and on trying the Api to sign in or signup using parameters I get the error :-



Undefined method `params_for_resource' for #<Api::V1::Overrides::RegistrationsController>


The code in registrations controller where the error is displayed :-
1)



def sign_up_params
params.permit(*params_for_resource(:sign_up))
end


2)



def validate_sign_up_params
validate_post_data sign_up_params,
I18n.t('errors.messages.validate_sign_up_params')
end


Routes.rb (in case needed):-



Rails.application.routes.draw do
devise_for :admin_users, ActiveAdmin::Devise.config
ActiveAdmin.routes(self)

namespace :api do
scope :v1 do
mount_devise_token_auth_for 'User', at: 'auth', controllers:
sessions: 'api/v1/overrides/sessions',
registrations: 'api/v1/overrides/registrations'

end
namespace :v1 do
resources :users
end
end
end


configure_permitted_parameters is now in ApiController.rb located under app/controllers



How do i workaround this and use both ActiveAdmin features and my API features?










share|improve this question
































    0















    I am using devise token auth gem to login and signup in a rails 5 Api and I am extending the same Api to be able to use ActiveAdmin to create an admin dashboard up and working which uses Devise to authenticate admin users. Inclusion of all the middlewares and config is done and also changed application controller to inherit from ActionController::Base and made an api_controller that inherits from ActionController::API.
    Routes are set too..
    But since I am using Overrides/registrations and sessions controller I changed them to inherit from class SessionsController < DeviseTokenAuth::ApiController and on trying the Api to sign in or signup using parameters I get the error :-



    Undefined method `params_for_resource' for #<Api::V1::Overrides::RegistrationsController>


    The code in registrations controller where the error is displayed :-
    1)



    def sign_up_params
    params.permit(*params_for_resource(:sign_up))
    end


    2)



    def validate_sign_up_params
    validate_post_data sign_up_params,
    I18n.t('errors.messages.validate_sign_up_params')
    end


    Routes.rb (in case needed):-



    Rails.application.routes.draw do
    devise_for :admin_users, ActiveAdmin::Devise.config
    ActiveAdmin.routes(self)

    namespace :api do
    scope :v1 do
    mount_devise_token_auth_for 'User', at: 'auth', controllers:
    sessions: 'api/v1/overrides/sessions',
    registrations: 'api/v1/overrides/registrations'

    end
    namespace :v1 do
    resources :users
    end
    end
    end


    configure_permitted_parameters is now in ApiController.rb located under app/controllers



    How do i workaround this and use both ActiveAdmin features and my API features?










    share|improve this question




























      0












      0








      0








      I am using devise token auth gem to login and signup in a rails 5 Api and I am extending the same Api to be able to use ActiveAdmin to create an admin dashboard up and working which uses Devise to authenticate admin users. Inclusion of all the middlewares and config is done and also changed application controller to inherit from ActionController::Base and made an api_controller that inherits from ActionController::API.
      Routes are set too..
      But since I am using Overrides/registrations and sessions controller I changed them to inherit from class SessionsController < DeviseTokenAuth::ApiController and on trying the Api to sign in or signup using parameters I get the error :-



      Undefined method `params_for_resource' for #<Api::V1::Overrides::RegistrationsController>


      The code in registrations controller where the error is displayed :-
      1)



      def sign_up_params
      params.permit(*params_for_resource(:sign_up))
      end


      2)



      def validate_sign_up_params
      validate_post_data sign_up_params,
      I18n.t('errors.messages.validate_sign_up_params')
      end


      Routes.rb (in case needed):-



      Rails.application.routes.draw do
      devise_for :admin_users, ActiveAdmin::Devise.config
      ActiveAdmin.routes(self)

      namespace :api do
      scope :v1 do
      mount_devise_token_auth_for 'User', at: 'auth', controllers:
      sessions: 'api/v1/overrides/sessions',
      registrations: 'api/v1/overrides/registrations'

      end
      namespace :v1 do
      resources :users
      end
      end
      end


      configure_permitted_parameters is now in ApiController.rb located under app/controllers



      How do i workaround this and use both ActiveAdmin features and my API features?










      share|improve this question
















      I am using devise token auth gem to login and signup in a rails 5 Api and I am extending the same Api to be able to use ActiveAdmin to create an admin dashboard up and working which uses Devise to authenticate admin users. Inclusion of all the middlewares and config is done and also changed application controller to inherit from ActionController::Base and made an api_controller that inherits from ActionController::API.
      Routes are set too..
      But since I am using Overrides/registrations and sessions controller I changed them to inherit from class SessionsController < DeviseTokenAuth::ApiController and on trying the Api to sign in or signup using parameters I get the error :-



      Undefined method `params_for_resource' for #<Api::V1::Overrides::RegistrationsController>


      The code in registrations controller where the error is displayed :-
      1)



      def sign_up_params
      params.permit(*params_for_resource(:sign_up))
      end


      2)



      def validate_sign_up_params
      validate_post_data sign_up_params,
      I18n.t('errors.messages.validate_sign_up_params')
      end


      Routes.rb (in case needed):-



      Rails.application.routes.draw do
      devise_for :admin_users, ActiveAdmin::Devise.config
      ActiveAdmin.routes(self)

      namespace :api do
      scope :v1 do
      mount_devise_token_auth_for 'User', at: 'auth', controllers:
      sessions: 'api/v1/overrides/sessions',
      registrations: 'api/v1/overrides/registrations'

      end
      namespace :v1 do
      resources :users
      end
      end
      end


      configure_permitted_parameters is now in ApiController.rb located under app/controllers



      How do i workaround this and use both ActiveAdmin features and my API features?







      ruby-on-rails devise activeadmin devise-token-auth






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 27 at 13:48







      barinder

















      asked Mar 27 at 11:38









      barinderbarinder

      65 bronze badges




      65 bronze badges

























          0






          active

          oldest

          votes










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55376293%2fundefined-method-params-for-resource%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes




          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55376293%2fundefined-method-params-for-resource%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript