help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
ruby-todo-list
/
app
/
helpers
RSK World
ruby-todo-list
Ruby Todo List - Task Management with User Authentication + Categories + Search + File Attachments + Email Notifications + Rails MVC + Modern Web Interface + API Integration + Educational Design
helpers
  • application_helper.rb2.6 KB
  • categories_helper.rb2.3 KB
  • tasks_helper.rb2.5 KB
application_mailer.rbapp.jstasks_helper.rb
app/mailers/application_mailer.rb
Raw Download
Find: Go to:
# Ruby To-Do List Application - Application Mailer
# Created by: Molla Samser (help@rskworld.in, +91 93305 39277)
# Address: Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India, 713147
# Year: 2026

class ApplicationMailer < ActionMailer::Base
  default from: "noreply@rubytodolist.com"
  layout 'mailer'
end
9 lines•320 B
ruby
app/helpers/tasks_helper.rb
Raw Download
Find: Go to:
# Ruby To-Do List Application - Tasks Helper
# Created by: Molla Samser (help@rskworld.in, +91 93305 39277)
# Address: Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India, 713147
# Year: 2026

module TasksHelper
  # Task priority options for select
  def priority_options
    [
      ['Low', 1],
      ['Medium', 2],
      ['High', 3]
    ]
  end

  # Task statistics for dashboard
  def task_statistics(user)
    {
      total: user.tasks.count,
      completed: user.tasks.completed.count,
      pending: user.tasks.pending.count,
      overdue: user.tasks.overdue.count,
      due_today: user.tasks.due_today.count
    }
  end

  # Progress percentage for completion
  def completion_percentage(user)
    total = user.tasks.count
    return 0 if total.zero?

    completed = user.tasks.completed.count
    ((completed.to_f / total) * 100).round
  end

  # Task status icon
  def task_status_icon(task)
    if task.completed?
      content_tag :i, '', class: 'fas fa-check-circle text-success'
    elsif task.overdue?
      content_tag :i, '', class: 'fas fa-exclamation-triangle text-danger'
    elsif task.due_today?
      content_tag :i, '', class: 'fas fa-clock text-warning'
    else
      content_tag :i, '', class: 'far fa-circle text-muted'
    end
  end

  # Task priority icon
  def task_priority_icon(priority)
    case priority
    when 1
      content_tag :i, '', class: 'fas fa-arrow-down text-success'
    when 2
      content_tag :i, '', class: 'fas fa-arrow-right text-warning'
    when 3
      content_tag :i, '', class: 'fas fa-arrow-up text-danger'
    else
      content_tag :i, '', class: 'fas fa-minus text-secondary'
    end
  end

  # Task card classes
  def task_card_classes(task)
    classes = ['card', 'mb-3', 'task-card']
    classes << 'border-success' if task.completed?
    classes << 'border-danger' if task.overdue?
    classes << 'border-warning' if task.due_today?
    classes.join(' ')
  end

  # Days until due date
  def days_until_due(due_date)
    return nil unless due_date

    days = (due_date - Date.current).to_i
    if days.negative?
      "#{days.abs} days overdue"
    elsif days.zero?
      "Due today"
    else
      "#{days} days left"
    end
  end

  # Task completion trend (last 7 days)
  def completion_trend(user)
    7.downto(1).map do |days_ago|
      date = days_ago.days.ago.to_date
      user.tasks.where(completed_at: date.beginning_of_day..date.end_of_day).count
    end
  end
end
93 lines•2.5 KB
ruby

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer