02 Feb '17, 11am

Управление сложностью в проектах на ruby on rails. Часть 3 - https://t.co/AmgYtIw2aO

# Базовый класс для всех форм # app/forms/base_form.rb class BaseForm include Virtus.model(strict: true) include ActiveModel::Model end # app/forms/user/statistics_filter_form.rb class User::StatisticsFilterForm < BaseForm attribute :start_date, ActiveSupport::TimeWithZone, default: ->(*) { DateTime.current.beginning_of_month } attribute :end_date, ActiveSupport::TimeWithZone, default: ->(model, _) { model.start_date.next_month } end # app/controllers/web/users/statistics_controller.rb class Web::Users::StatisticsController < Web::Users::ApplicationController def show # тут не обязательно использовать permits, т.к. это актуально только для active_record моделей @filter_form = User::StatisticsFilterForm.new params[:user_statistics_filter_form] @statistics = UserStatisticsQuery.perform resource_user, @filter_form.start_date, @filter_form.end_date end end = simple_form_for @f...

Full article: https://habrahabr.ru/post/321034/

Tweets

Y tu cuando vas a aprende Ruby on Rails 5?

Y tu cuando vas a aprende Ruby on Rails 5?

gumroad.com 01 Feb '17, 5pm

La forma en cómo usamos el Internet hoy en día ha cambiado desde que se masificó en 1995. Ya quedaron atrás los días en lo...

Write some Software in Ruby on Rails by rezabyte

freelancer.com 02 Feb '17, 8am

senior ruby on rails engineer software developer freelancer , ruby rails project software , ruby rails thon software , rub...

We are looking for a Production Support #Engine...

boards.greenhouse.io 02 Feb '17, 9pm

Our development team works on the entire tech stack (from low level database operations to front end development) for a la...

“NodeJS vs Ruby on Rails comparison 2017. Which...

medium.com 03 Feb '17, 2pm

NodeJS vs Ruby on Rails comparison 2017. Which is the best for web development? It’s hard for a startup to choose the righ...