small medium large xlarge



Christopher Govender says:

This code should go in /views/application.html.erb after the ‘contact’ link in the side column. ...
  • <%=“%I:%M %p) %>
  • Then you should go to /stylesheets/application.css.scss and add – color: #bfb to the nested li selector. It will then be visible.

    Young says:

    The code should not be <%="%I:%M %p) %>, It should be <%='%I:%M %p‘) %>

    Jakub Tuček asks:

    Tried two different ways how to set this outside of the view inspired by stack overflow

    First with helper method in app/controller/application_controller.rb
    class ApplicationController < ActionController::Base
    *  helper_method :date_loaded
    *  def date_loaded
    *    return
    *  end
    in the view then just <%= date_loaded %>

    Second setting what should be called before (do not know what) in the controller
    class ApplicationController < ActionController::Base
    *  before_filter :set_date
    *  def set_date
    *    @date_loaded =
    *  end
    in view then goes just <%= @date_loaded %>

    I consider first the best, prepare helper (maybe in different location, do not know yet) and use it in layout, but if is there any reason to prefer other way (hardcode in layout, or local attribute)? why? thanks in advance.

    Page History
    • V19: David Hislop [10 months ago]
    • V18: David Hislop [10 months ago]
    • V17: David Hislop [10 months ago]
    • V16: Dennis Sutch [almost 2 years ago]
    • V19: Warren Bain [about 3 years ago]
    • V18: Jakub Tuček [over 3 years ago]
    • V17: Jakub Tuček [over 3 years ago]
    • V16: Jakub Tuček [over 3 years ago]
    • V15: Jakub Tuček [over 3 years ago]
    • V14: Jakub Tuček [over 3 years ago]