Skip to content

Instantly share code, notes, and snippets.

@Frank004
Created November 3, 2015 03:07
Show Gist options
  • Save Frank004/91fd606ac87ef178ebbd to your computer and use it in GitHub Desktop.
Save Frank004/91fd606ac87ef178ebbd to your computer and use it in GitHub Desktop.
En el article block pones una de estas
<%= link_to article.user.name, user_path(article.user_id) %>
or
<%= link_to article.user.name, user_path(article.user.id) %>
devise_for :users
resources :users, only: [:show, :index]
class UsersController < ApplicationController]
before_action :set_user, only:[:show]
def show
end
private
def set_user
@user = User.find_by(username: params[:id])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment