# rodauth

Published articles for rodauth.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Rails 7, Rodauth, BootRails, Nested Resources and Testing Controllers

DevFeed: [Rails 7, Rodauth, BootRails, Nested Resources and Testing Controllers](<https://devfeed.tech/articles/rails-7-rodauth-bootrails-nested-resources-and-testing-controllers-28282.md>)

Original publisher: [Read original article](<http://fuzzyblog.io/blog/rails/2022/06/10/rails-7-rodauth-bootrails-nested-resources-and-testing-controllers.html>)

Author: Fuzzygroup

Published: 2022-06-10T08:12:00Z

Content type: tutorial

Language: en

Sources: [Scott Johnson](<https://devfeed.tech/sources/scott-johnson.md>)

Topics: [Rails](<https://devfeed.tech/topics/rails.md>), [Authentication](<https://devfeed.tech/topics/authentication.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Security](<https://devfeed.tech/topics/security.md>)

Tags: [account](<https://devfeed.tech/tags/account.md>), [authentication](<https://devfeed.tech/tags/authentication.md>), [controllers](<https://devfeed.tech/tags/controllers.md>), [framework](<https://devfeed.tech/tags/framework.md>), [rails](<https://devfeed.tech/tags/rails.md>), [rodauth](<https://devfeed.tech/tags/rodauth.md>), [testing](<https://devfeed.tech/tags/testing.md>)

### AI overview

A Rails 7 development account describes using BootRails and RodAuth with nested account and link resources. The article explains authentication-aware routing and discusses adapting generated scaffolding and controller parameter handling for nested-resource testing.

### Source excerpt

I'm working on a new project and, as I am front end challenged, I started by purchasing a copy of the BootRails framework as it seemed to have sensible defaults and an appearance that vastly outstrips my personal ability to manipulate Bootstrap. Previously I've worked with the JumpStart framework from Go Rails and while I love, love, love Chris Oliver, GoRails, HatchBox and everything Chris has done (yes I'm a super fan), I just can't get past JumpStart's use of Tailwind. BootRails makes a bunch of fairly opinionated decisions including the choice of RodAuth for authentication. They also use minitest and fixtures instead of rspec and FactoryBot. This blog post will cover how I figured out how to make testing work in a RodAuth environment for a nested resource. Note: It has literally been years since I've used nested resources but the application I'm developing is one where I particularly don't want security holes and nested resources nicely handle that. And, yes, I'm tipping my hat towards Sean Kennedy in Arkansas who taught me all about nested resources about a thousand years ago, way, way pre-pandemic. Unlike devise and everything else I've ever used in Rails, RodAuth has current_account instead of current_user. So you have an account object instead of a user object (I'm not saying it is wrong but it is different). For my application I have two resources: account link My routes file looks like this: constraints Rodauth::Rails.authenticated do resources :accounts do resources :links end end This means that my urls will look something like this: /account/23/link/99 i.e. you have to be logged in as account 23 to access link 99. Note: Writing the line above makes me realize that no other account can ever reference link 99 since the account is the parent object of the resource. The likely needed change is to nest these under the project object and then have a account_project model. But, as always, I digress. My first thing when I generated the links model was to scaffo