Skip to main content

All Questions

Tagged with
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:...
user9174081's user avatar
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 '...
Luigi De Cosmis's user avatar
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 ...
Spiros's user avatar
  • 2,266
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[:...
John Sall's user avatar
  • 1,107
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 => ...
iconoclast's user avatar
  • 22.2k
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: ...
Sergey Panov's user avatar
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 ...
noloman's user avatar
  • 11.8k
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 ...
William's user avatar
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, ...
AntMar's user avatar
  • 23
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 ...
Dudo's user avatar
  • 4,111
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 ...
Yukiyu's user avatar
  • 69
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 ...
josegp's user avatar
  • 529
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' ...
edprez's user avatar
  • 1
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 ...
Tanmay Mahamulkar's user avatar
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 ...
soltex's user avatar
  • 3,363

15 30 50 per page
1
2 3 4 5
109