1

I would like to add a reinvite user button on my users show page.

My reinvite button looks like this:

    def reinvite
        User.reinvite!
    end

And the button looks like this:

    <%= link_to(
  "Reinvite User",
  [namespace, page.resource],
  class: "button",
  ) if valid_action?(:reinvite) && show_action?(:reinvite, 
  page.resource) %>

But the button don't render on the show page.

  • How are `valid_action?` and `show_action?` defined? What is `page.resource`? Is there a user currently logged in? – spickermann Oct 29 '18 at 08:22
  • 1
    I found the solution, I had to define a route for my action as suggested [here](https://github.com/thoughtbot/administrate/issues/222) – rake-write-code Oct 30 '18 at 09:14

0 Answers0