All Questions
1,628
questions
0
votes
1
answer
41
views
Rails Routing - 'api/v1/sessions' is not a supported controller name [closed]
Rails.application.routes.draw do
namespace :api do
namespace :v1 do
resources :users, only: [:create, :show, :index]
post '/login', to: 'sessions:#create'
delete '/logout', to:...
1
vote
1
answer
82
views
form_with is trying to generate the action with the wrong path
I'm experimenting with routing and namespaces.
When implementing a form with <%= form_with model: [@user, @address] do |form| %>
i receive this error undefined method '...
1
vote
1
answer
50
views
Rails engine: export two sets of routes
I have a Rails engine MyGreatEngine defined in a gem mge. This engine provides two types of routes, one related to APIs and one related to static files.
I would like to export two sets of routes, one ...
0
votes
1
answer
109
views
Rails 7 won't generate a destroy path for the comment deletion [closed]
I'm trying to make a delete helper for a comment, this is the html code :
<% if store_comment.user_id == current_user.id %>
<%= link_to 'edit', edit_store_post_store_comment_path(params[:...
1
vote
1
answer
133
views
An accepted way to get Current.user in routes.rb
I have a number of Rails engines in a Rails app, and each currently has its own constraint class to determine whether to allow the user
mount Flipper::UI.app(Flipper) => '/admin/flipper', :as => ...
1
vote
1
answer
23
views
Reference custom resource path from the view
I would like to call a custom controller method "load" from the view. I am struggling to understand how I should call the path to call in the view. In my routes.rb I have the following code:
...
1
vote
1
answer
99
views
Ruby on Rails: sign out isn't working for devise with User
I have the following routes:
I'm developing an exercise tracking app and I want to have tracked_exercises for the currently logged in user. This is my routes.rb file:
Rails.application.routes.draw do
...
0
votes
0
answers
42
views
I try to open users/new but I get routing error
I am a programmer who is just starting out, but I don't know how to fix this error since I don't see any flaws in it
I need help to continue with the project
Routes
Rails.application.routes.draw do
...
0
votes
2
answers
140
views
Add a static Thank You page on form submit using Rails
New to Rails but having difficulty getting this thank you page to load.
Problem: A website visitor can fill out the contact us form on my site, then get routed to a generic Thank You page. However, ...
2
votes
2
answers
559
views
How to find rails route pattern from url
Given a rack request where I know the path, e.g. /things/1, how can I get the route reference e.g. /things/:id?
I can use Rails.application.routes.recognize_path to get the controller and action, but ...
0
votes
3
answers
76
views
Error when deleting microposts. For some reason the GET method is requested for https
Please understand that I am not familiar with English.
I am creating a sample application with Rails.
For some reason the following error occurs when I press the delete button on a micropost.
error
...
0
votes
1
answer
87
views
Ruby on Rails - Duplicate routes & impact on controllers
I am creating a Task Manager.
So, I have:
A dashboard where I can do CRUD for tasks (and then I will assign them a group)
A group section where I can go inside a group and do CRUD for tasks
Then my ...
0
votes
0
answers
34
views
How can I redirect website.com/en to website.com/en/ in Rails?
We have this in routes.rb for localization:
scope "/:locale", locale: /#{I18n.available_locales.join("|")}/, defaults: {locale: 'nl'} do
get '/', to: 'home_student#index'
...
0
votes
0
answers
46
views
RoutingError (No route matches [GET] "/packs/application-8e6ca2ce7d44b0980e70.js"
The js code from the application fails while loading cause I made some changes with the NPM and eslint. Any solution for it?
Not going to profile tab (No routing error)
import 'core-js/stable';
import ...
1
vote
0
answers
38
views
routes: match '*path' does not catch POST /
I am using this rule:
match '*path', via: :all, to: 'application#index'
to redirect all unknown routes to application#index.
However, it does not catch POST /, it returns the following error:
No ...