title: undefined method `strftime'
body: <p>hy 
   After i have created the event of the user, i try to see it but i get an error 
    error undefined method `strftime' for nil:NilClass</p>
  
  <p>I don't understand why i get this error because until apply the association everything doing well</p>
  
  <p><strong>show.html.erb</strong></p>
  
  <pre><code>     &lt;p class="info"&gt;Evénement crée le &lt;%= @calendar.published_on.strftime("%e %B, %Y") %&gt;
     10 &lt;%= simple_format @calendar.description %&gt;
     11 
     12 &lt;p&gt;edit_calendar_path(:id)&lt;/p&gt;
     13 &lt;%= link_to 'Edit', edit_calendar_path(@calendar) %&gt; |
     14 &lt;%= link_to 'Back', user_calendars_path %&gt; |
  </code></pre>
  
  <p><strong>calendar.controler.rb</strong></p>
  
  <pre><code>  def index
      #@content_calendars = @user.Calendar
    @user = current_user
      @content_calendars = @user.Calendar.all
      @content_calendars_by_dates = @content_calendars.group_by(&amp;:published_on)
      @date = params[:date] ? Date.parse(params[:date]) : Date.today
    end
  
    def show
      @user = current_user
     # @calendar = @user.find_all_calendar_by()
      #  @tasks = @project.tasks.find_all_by_complete(false)
      @calendar = @user.calendar.find(params[:id])
    end
  
  
    def new
      @user = current_user
     # @calendar = @user.build_calendar
     @calendar = @user.calendar.build
    end
  
  def create
      @user = current_user
      @calendar = @user.calendar.build(params[:id])
      #@calendar = @user.Calendar.new(params[:calendar])
      if @calendar.save
         #redirect_to calendar_path(@user)
         redirect_to [@user,@calendar]
         #, notice: "L evenement a ete cree"
      else
        render :new
      end
    end
  </code></pre>
  
  <p><strong>show.html.erb</strong></p>
  
  <pre><code>&lt;% if user_signed_in? %&gt;
       &lt;%= stylesheet_link_tag "index.css" %&gt;
       &lt;%= stylesheet_link_tag "calendar.css" %&gt;
  
      &lt;%= csrf_meta_tags %&gt;
  
        &lt;div id="white-container"&gt; &lt;!-- Start White Container --&gt;
           &lt;br/&gt;
           &lt;div class="page-width"&gt;&lt;!-- Start Page Width Content Box --&gt;
        &lt;div class="contentbox"&gt;
          &lt;div id="calendar"&gt;New calendar&lt;/div&gt;&lt;br /&gt;
  
           &lt;%= render 'form' %&gt;
           &lt;%= link_to 'Back', user_calendars_path %&gt;
  
      &lt;% else %&gt;
          &lt;span&gt;
            &lt;% flash[:info] = ''%&gt;
          &lt;/span&gt;
              &lt;%= render 'devise/sessions/form' %&gt;
      &lt;% end %&gt;
  
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p><strong>_form.html.erb</strong></p>
  
  <pre><code>&lt;%= form_for([@user, @calendar]) do |f| %&gt;
    &lt;% if @calendar.errors.any? %&gt;
      &lt;div id="error_explanation"&gt;
        &lt;h2&gt;&lt;%= pluralize(@calendar.errors.count, "error") %&gt; prohibited this calendar from being saved:&lt;/h2&gt;
  
        &lt;ul&gt;
        &lt;% @calendar.errors.full_messages.each do |msg| %&gt;
          &lt;li&gt;&lt;%= msg %&gt;&lt;/li&gt;
        &lt;% end %&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
    &lt;% end %&gt;
  
    &lt;div class="field"&gt;
      &lt;%= f.label :event %&gt;&lt;br /&gt;
      &lt;%= f.text_field :event %&gt;
    &lt;/div&gt;
    &lt;div class="field"&gt;
      &lt;%= f.label :published_on %&gt;&lt;br /&gt;
      &lt;%= f.text_field :published_on, :size=&gt;"10", :text_align=&gt;"center" %&gt;
    &lt;/div&gt;
    &lt;div class="field"&gt;
      &lt;%= f.label :description %&gt;&lt;br /&gt;
      &lt;%= f.text_area :description, :rows =&gt; "10", :cols=&gt; "30" %&gt;
    &lt;/div&gt;
    &lt;div class="actions"&gt;
      &lt;%= f.submit %&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>