Ruby on Rails Friday, February 10, 2017

On Friday, February 10, 2017 at 1:25:37 PM UTC+1, Colin Law wrote:
On 10 February 2017 at 12:16, 'krfg' via Ruby on Rails: Talk
<> wrote:
> Ok, thanks for the suggestion.
> I will try to use tail if it works with such a heavy file, otherwise I would
> need instructions on how to empty the file.
> The most important thing I have to understand is: where should I place
> In static_pages_controller.rb before the declaration of @atp_tournaments
> variable?

The purpose of inserting the line is firstly to check that the above
line is being reached, but secondly to check the value of the
variable. To check the value of the variable you must put it after the
line determining @atp_tournaments.


As you suggested I inserted immediately after the declaration of @atp_tournaments in static_pages_controller.rb:

  def home
      if logged_in? && !current_user.gamer?
      elsif logged_in? && current_user.gamer?
          @week_num ="%W").to_i
          @atp_tournaments = AtpCalendar.where("week @> ?", "{#{@week_num}}")
"atp tournaments count = #{@atp_tournaments.count}")
          @wta_tournaments = WtaCalendar.where("week @> ?", "{#{@week_num}}")

Using tail -n 100 log/test.log I got the following outut:

atp tournaments count = 0

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment