Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use "Creating Friendly URLs and Caching" in "member do" ? #1084

Open
akkyta opened this issue Apr 26, 2022 · 0 comments
Open

How to use "Creating Friendly URLs and Caching" in "member do" ? #1084

akkyta opened this issue Apr 26, 2022 · 0 comments

Comments

@akkyta
Copy link

akkyta commented Apr 26, 2022

I want to use the contents described in the "Creating Friendly URLs and Caching" of the README.md in the "member do" of routes.
I've tested it a lot, but I get an error and can't use it.

I use Rails 5.2.5

My routes code is this.

resources :events do
 member do
  get 'message' => 'events#message'
 end
end

my events contoroller's method "message" is this.

supporters =  Supporter.where(id: params[:id])
@message = Kaminari.paginate_array(supporters).page(params[:page]).per(##)

and I tried this code

resources :events, concerns: :paginatable do
 member do
      get '(message/:page)', action: :index, on: :collection, as: ''
    end
end

and

concern :paginatable do
  get '(message/:page)', action: :index, on: :collection, as: ''
end

resources :events do
 member do
  get 'message' => 'events#message'
 end
end

I've done a lot of other tests, but all of them resulted in a routes error.

I am very confused about how to solve this problem.
I would appreciate it if you could help me.
Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant