Users of my application upload an avatar when they create their profiles. Here is how I display a small version of their profile picture in the navbar:

 &lt;li&gt;&lt;%= link_to image_tag current_user.avatar(:nav) %&gt;&lt;/li&gt;


I want that link to to go to the profile page of the current user. Here are my routes:

  Prefix Verb   URI Pattern                    Controller#Action
                  things GET    /things(.:format)              things#index
                         POST   /things(.:format)              things#create
               new_thing GET    /things/new(.:format)          things#new
              edit_thing GET    /things/:id/edit(.:format)     things#edit
                   thing GET    /things/:id(.:format)          things#show
                         PATCH  /things/:id(.:format)          things#update
                         PUT    /things/:id(.:format)          things#update
                         DELETE /things/:id(.:format)          things#destroy
        new_user_session GET    /users/sign_in(.:format)       devise/sessions#new
            user_session POST   /users/sign_in(.:format)       devise/sessions#create
    destroy_user_session DELETE /users/sign_out(.:format)      devise/sessions#destroy
           user_password POST   /users/password(.:format)      devise/passwords#create
       new_user_password GET    /users/password/new(.:format)  devise/passwords#new
      edit_user_password GET    /users/password/edit(.:format) devise/passwords#edit
                         PATCH  /users/password(.:format)      devise/passwords#update
                         PUT    /users/password(.:format)      devise/passwords#update
cancel_user_registration GET    /users/cancel(.:format)        devise/registrations#cancel
       user_registration POST   /users(.:format)               devise/registrations#create
   new_user_registration GET    /users/sign_up(.:format)       devise/registrations#new
  edit_user_registration GET    /users/edit(.:format)          devise/registrations#edit
                         PATCH  /users(.:format)               devise/registrations#update
                         PUT    /users(.:format)               devise/registrations#update
                         DELETE /users(.:format)               devise/registrations#destroy
                   users POST   /users(.:format)               users#create
                new_user GET    /users/new(.:format)           users#new
                    user GET    /users/:id(.:format)           users#show
                   about GET    /about(.:format)               pagess#about
                    root GET    /                              things#index


I am currently using Devise for authentication.

Here is my UsersController

class UsersController &lt; ApplicationController
  def show
    @user = User.find_by_username(params[:id])
  end

  def user_params
      params.require(:user).permit(:avatar)
  end
end



Question: Why are there so many different types of screws (phillps/flat/hex/star/etc)?
Answer: The full list of reasons (partially based on some other good answers here) seems to be:


design improvements (a "good thing" on the road to the world having the best screws)


When people come up with improved designs, those start to get used.


network effects (a "bad thing")


Some people will stick with older, inferior designs that have many users, since those will be easier to find and they will already have the screwdrivers and bits for them.  Also...


economy of scale (a "bad thing")


...gives an advantage to more established designs (even if they are terrible), as production of those will be large-scale and efficient, so new designs (better or worse) will tend to be more expensive.


patenting (and other business reasons that have nothing to do with design) (a "bad thing")


As Chris Cudmore points out in a comment to a different answer here, this is the reason Phillips screws are more widespread than Robertson (square) screws, despite Robertson ones being generally better (far more difficult to strip the heads.  ...and what was Ford's first choice again?  ...exactly.).


desire to have some things be tamper-proof (mostly a "bad thing")


Guarding against vandalism (special washroom stall screws) and preventing theft (special car wheel lug nuts) are decent goals, but the motives are not always as good.  (Is Apple just trying to protect users against themselves with pentalobe screws, or are there other, worse reasons for them, such as pushing more people back Apple for any repairs?)  The tamper-proof requirement is pretty clearly at odds with what most users would want, though, as each variation means another set of screwdrivers or bits someone would need to own to be prepared.   Of course the fact that the designers of these screw heads often make money off each screwdriver or bit sold points to that being one reason the screw is out there in the first place.


different applications (mostly a "good thing")


To end on a positive note after all of that, the different applications of screws really do leave room for multiple "best" designs.  The points about wet applications and applications with small countersink-type heads (which can only fit much smaller bit sizes of the grippier designs) are great.



(Still...  We would be much better off if we just started using Robertson screws 99% of the time!)

Actually, triangle heads should be best.  They should have the best torque (as long as the sides are vertical), while still being simple to cut (low manufacturing costs).  I just looked up whether they exist, though, and apparently they are being used as yet another tamper-proof design.