Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
54 views

I would like to build resource route for a resource that has slash-delimited IDs. The routes would look something like this where *path takes the place of :id resources GET /resources(.:format) ...
Galen's user avatar
  • 1
1 vote
1 answer
74 views

I am new to ruby-on-rails and having a hard time trying to get routes to match for my API service. I designed my custom routes for resources following the Google AIP-136. For example, for the ...
Saurav Das's user avatar
0 votes
0 answers
63 views

I have to change the route in a way that I need to have the original route as well as change the path of the route in a env is available. this is how I am thinking of doing custom_org = ENV['...
Burhan Gardezi's user avatar
0 votes
0 answers
190 views

I have a project where I am using rails as my backend and I have a model called "Projects". I am trying to do a simple redirect to my index action after deleting a single project but I keep ...
Kevin B.'s user avatar
  • 121
0 votes
2 answers
635 views

I am using rails 7 and When I click on logout it show an error that logout path is not found. Here is my code of routes.rb, session controller and header section for logout: Rails.application.routes....
Afaq Shahid Khan's user avatar
0 votes
2 answers
135 views

I am using Rails 7 Active admin I have Project that is Workshop Project that is related to organizing workshops, booking them etc. I am using Friendly ID Gem . The url looks like http://127.0.0.1:3000/...
Muhammad Bilal's user avatar
2 votes
1 answer
63 views

I need to create a Ruby on Rails API where routes will look like mydomain.com/api/v1/xxxxxxxx/ mydomain.com/api/v1/xxxxxxxx/messages mydomain.com/api/v1/xxxxxxxx/authors/123/books xxxxxxxx ...
equivalent8's user avatar
  • 14.3k
0 votes
0 answers
40 views

I am showing a view where I show several records and I have a checkbox that I would like that when I change its value is sent via ajax the request to update the record, so far it works fine and ...
jeff's user avatar
  • 387
0 votes
2 answers
126 views

I need to show notice/pop ups upon hitting of a button. Similar approaches are working in other views and controllers of the app but here on this Import button things are not working since long. None ...
Meet Makwana's user avatar
0 votes
2 answers
64 views

I haven't been able to solve the error for a couple of days because of the nested path, what is the problem? I realize that there is no such nested path as Rails is looking for, but why is he looking ...
antnbaranov's user avatar
1 vote
0 answers
138 views

I would like to create a new routes and method inside my Sessions Controller within Devise. I am using devise_token_auth Here is my original routes.rb for devise : namespace :api do namespace :v1 ...
SJU's user avatar
  • 3,322
1 vote
1 answer
123 views

We have a tenant-like application that specifies many tenant and general routes for the same controller/action. As an example: get '/:subdomain/posts', to: 'posts#index' get '/posts', to: 'posts#index'...
Kieran E's user avatar
  • 3,686
0 votes
1 answer
139 views

I have been banging my head against the wall all day today with this problem. I am building an onboarding wizard where I collect business information. It's many steps, but for this I will post simply ...
3BB's user avatar
  • 802
1 vote
2 answers
928 views

New to programming in general and Rails specifically. TLDR: Is there a clean way of using a variety of member actions or controlling flow in controllers for nested resources? Is there a third option? ...
hfholden's user avatar
0 votes
0 answers
475 views

I'm using ruby 3.1.0p0 and Rails 7.0.1. I recently upgraded from Rails 6.1 and ruby 2.7. When I host the site locally I don't encounter any issues. But when I deploy the site to a Ubuntu 20.04 server ...
Jason Shultz's user avatar
1 vote
1 answer
230 views

I originally had a route defined like this : get ':foo(/:bar)/:baz(/:qux)/:slug', to: 'application#show', constraints: { baz: /.+?\-\d+/ }, as: test With this configuration, it works fine if I omit :...
Ruur's user avatar
  • 205
0 votes
1 answer
76 views

I have a data scraper in ruby that retrieves article data. Another dev on my team needs my scraper to spin up a webServer he can make a request to so that he may import the data on a Node Application ...
jMwofford's user avatar
0 votes
1 answer
260 views

I have a Consultant model, where i have multiple consultant types (lawyers, doctors, psychologists etc.) listed on different websites, all handled from the same rails project. I would like to have the ...
Tobias's user avatar
  • 131
0 votes
1 answer
188 views

I have bellow url request type, that contain # character http://localhost:3000#user-name I want to match it to HomeController#show_user, how to write the routes?
Tiktac's user avatar
  • 1,068
0 votes
1 answer
150 views

I have a basic Page model in Rails that I'm using with FriendlyId to allow admins to create pages like "/about" or "/contact". I have the following in my routes file (config/routes....
Lee McAlilly's user avatar
  • 9,344
1 vote
2 answers
394 views

I have set up the authentication using devise user, and in that I am having my albums controller in which i am inserting multiple images. So far I have just created a method for deletion of image in ...
Damon's user avatar
  • 13
0 votes
0 answers
54 views

I have one controller for creating category, and I want to have one more nested controller to create language versions of categories. I want to avoid methods like new_language, edit_language, ... and ...
Levi's user avatar
  • 77
0 votes
0 answers
284 views

I have an app where the routes are: # many routes go here # last item in routes.rb: get ':username' => 'users#show' This allows routes of the form www.example.com/your_username This works ...
dss's user avatar
  • 477
0 votes
1 answer
334 views

I have three resources in ActiveAdmin i.e User, Order, and OrderItems. User => has_many :orders User => has_many :order_items, through: :orders I want OrderItems to be nested inside Users so I ...
sgk's user avatar
  • 169
0 votes
1 answer
158 views

I have the following routes: Brand.all.each do |brand| get "/#{brand.slug}", to: 'brands#index'# end That generates: "/tommy" "/lacoste" "/gap" But when I ...
AjjjHsh's user avatar
  • 253
0 votes
1 answer
172 views

I want to create URLs of the form /suffix-<slug> with rails but I can't see how to map that on the routes.rb, how can I do that?
Leonardo's user avatar
  • 2,504
0 votes
1 answer
604 views

I am currently working on a Rails engine that will duplicate the host app's routings under a certain scope. So if a route get '/posts', to: 'posts#index', as: 'posts' exists in the original ...
tobiasbhn's user avatar
0 votes
1 answer
38 views

With my rails api. At the moment if I do a get request to /seasons/2 I correctly have a json returned with the season table item of id= 2 through the Seasons controller show action. But when I hit a ...
user13948121's user avatar
0 votes
1 answer
158 views

current_page? doesn't work with POST requests, but there is said to be a solution here. I try using url_for like so: current_page?(url_for(controller: 'pages', action: 'booking_confirm')) # but.. ...
stevec's user avatar
  • 55.3k
2 votes
1 answer
771 views

Trying to implement redirect_to :back method but I'm getting this error: uninitialized constant ActionController::RedirectBackError Did you mean? ActionController::RenderError my posts_controller.rb ...
spirito_libero's user avatar
0 votes
1 answer
484 views

So I am trying to nest resources under a namespace, however when i try to navigate to the UserProfile new page I am hitting the following error: ActionController::RoutingError at /users/xxxxxx/...
Shawn Wilson's user avatar
  • 1,381
1 vote
2 answers
387 views

The simplest MRE is rails g scaffold users As we create users, their id will be 1, 2, 3, 4 etc, and their 'show' route will be /show/:id Sometimes we don't want users of the website to know exactly ...
stevec's user avatar
  • 55.3k
0 votes
1 answer
54 views

i have this in my routes.rb get "invoices/log_out" => "users#logout", :as => "log_out" this seems to work only in localhost:3000/invoices/new/log_out as when i ...
kostasew's user avatar
0 votes
0 answers
362 views

I am trying to send a POST request (using Postman) to sign up a new user using devise token auth and I am overriding the registrations controller to enable my own JSON responses. I keep getting a ...
Ryan McClure's user avatar
0 votes
1 answer
388 views

I would like to rename my categories URL from https://website.com/categories/apples (#1) to https://website.com/hi-apples-bye (#2) I am trying to accomplish two things: Display the #2 URL in the ...
Steve's user avatar
  • 1
0 votes
1 answer
1k views

How to rewrite below URL 127.0.0.1:3000/article/index?type=1 as 127.0.0.1:3000/article/category/brand where type 1 is category with name brand. is it possible using rails? route.rb get "article/...
Adwait soni's user avatar
0 votes
2 answers
2k views

I've tested my project with development env and everything works fine but after I upload my project to the host I got this error. # log [2020-02-17T14:54:55.319109 #2097106] INFO -- : [2ac848c8-15f3-...
hsul4n's user avatar
  • 523
0 votes
1 answer
103 views

I'm using devise for sign up and ActiveStorage for image upload. For the delete/purge function to work I have this route devise_scope :user do scope module: :users do resources :...
kvnirvana's user avatar
0 votes
0 answers
152 views

I followed these instructions, but now I'm running into a problem. When I click my unsubscribe_url in the email, I get the following error: No route matches [GET] "/newsletter_subscriptions/...
Ernest Mistiaen's user avatar
1 vote
1 answer
4k views

I am on: Rails: 6.0.1 Ruby: 2.6.5 And I am using Rails.application.routes.url_helpers.rails_blob_path helper in one of my serializers to generate path to a pdf file. And it has been working great in ...
Zia Ul Rehman's user avatar
0 votes
2 answers
22 views

I need to create a rout, which url will look like this: www.sitename.com/action_name/[:id] Write it as follows: get '/how-to-transfer-colleges/:id', to:'seo_pages#how_to_transfer_colleges' get '/how-...
Денис Саенко's user avatar
3 votes
2 answers
4k views

I feel like there's no easy way to do this in rails, but since I'm fairly noob in rails I decided to ask for solutions: I have a form in a view that contains a single (text) input. How can I specify ...
pedrorijo91's user avatar
  • 7,945
-1 votes
1 answer
102 views

My relationship is as follows: Users have many Cartitems; Cartitems belong to Users, Cartitems have many Products; Products belong to Cartitems Therefore, Users have many Products through Cartitems ...
deejay123's user avatar
0 votes
2 answers
365 views

So I've got a simple database for an online retail store with a relationship of Users who have many Products through Cartproducts Users have many cartproducts and have many products through ...
deejay123's user avatar
3 votes
3 answers
813 views

I'm trying to allow for one resource, Site, to conditionally have a parent resource, Organization. Here's what I currently have: resources :site do resources :posts do resources :comments ...
you786's user avatar
  • 3,570
0 votes
1 answer
156 views

I have a rails engine which is mounted on my application as mount Engine::Engine, at: "/engine" Is it possible to translate the namespace /engine so that in English it is /engine and in another ...
Kingsley Simon's user avatar
0 votes
3 answers
592 views

I need to create two routes. The first one is a GET route that shows a certain form, and the other is a POST route that processes the form. For example, I need to create a route that shows a form ...
Ruur's user avatar
  • 205
0 votes
1 answer
232 views

I have this set of routes resources :flatfiles do collection do delete :custom_destroy end end And I would like to all of the routes to include :key E.g. get 'flatfiles/:key' =>...
stevec's user avatar
  • 55.3k
1 vote
1 answer
294 views

I'm trying to get Rails generated _path methods to give me /terms_and_conditions?utm_source=source&utm_campaign=pain#some_link So I've tried the following in a controller: utm_params = {"...
user208769's user avatar
  • 2,256
1 vote
2 answers
222 views

How to send a variable/parameter from an action without using the URL? I need to create a user in multiple steps, and the user is created on the 2nd step. I need to receive the email of the user from ...
Arslan Ali's user avatar
  • 17.9k

1
2 3 4 5
20