Question: I am working on ROR apps and Mongo DB , App has two controller :   

1) Portfolio --- All method related to admin.

2) Target ---- All actions which are used for public display of data.

Now I want to put a log in page into my website so only login users can see views related to portfolio ? How can I do that. Any lead will be appreciated.

Answer: 
I would look into either RailsAdmin:

<https://github.com/sferik/rails_admin>

Or try ActiveAdmin:

<https://github.com/gregbell/active_admin>

They both include Devise, as suggested by grotori, and give you admin panel functionality out of the box.

If you're using Mongoid, you'd also want to look at:

<https://github.com/elia/activeadmin-mongoid>

RailsAdmin also supports Mongoid by default.
If you don't want an administrator panel, you can just use Devise:

<https://github.com/plataformatec/devise>

You can then use `user_signed_in?` to control what is shown to the user. In other words:

```
<% if user_signed_in? %>
  Only signed in users can see this message!
<% end %>

```