Каждая страница устанавливает свой класс для элемента body в зависимости от controller, action и layout. Например для страницы вывода заявок на БВ в админке это было бы
<body class="admin page-ownership_requests page-ownership_requests-index">title Подача заявки на бесплатный аккаунт БВ
Actor->HomeController: GET /ownership/
HomeController-->Actor: 200 description text
alt Гость
Actor->RequestsController: GET /ownership/requests/new
RequestsController-->Actor: 200, email, fio
| require 'formula' | |
| class Vim <Formula | |
| url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2' | |
| homepage 'http://www.vim.org/' | |
| md5 '5b9510a17074e2b37d8bb38ae09edbf2' | |
| version '7.3.135' | |
| def patchlevel; 135 end | |
| def features; %w(tiny small normal big huge) end |
| def render(options = {}, local_assigns = {}, &block) #:nodoc: | |
| local_assigns ||= {} | |
| case options | |
| when Hash | |
| options = options.reverse_merge(:locals => {}) | |
| if options[:layout] | |
| _render_with_layout(options, local_assigns, &block) | |
| elsif options[:file] | |
| template = self.view_paths.find_template(options[:file], template_format) |
| module OptHelper | |
| def opt(name) | |
| local_assigns[name.to_sym].presence | |
| end | |
| end | |
| plan.allow? "Business", :add_photos, :subject => business | |
| # если в качестве неймспейса передана не строка и не символ то | |
| # неймспейсом берется класс объекта и он же подставляется как subject | |
| plan.allow? business, :add_photos | |
| module OmniAuth | |
| class ReturnPathMiddleware | |
| def initialize(app) | |
| @app = app | |
| end | |
| def call(env) | |
| if auth_request?(env) && asseptable_referer?(env) | |
| save_referer(env) |
| var abonent = AbonentsCollection.build(user_data); | |
| var view = new Map.Abonent(abonent); | |
| Madiator.addAbonentView(view); | |
| .... | |
| .click(function(ev){ | |
| Mediator.showOnMap($(ev.target).attr('abonent_id')) | |
| }) |
| class AuthenticationsController < ApplicationController | |
| def create | |
| service = AuthenticationService | |
| response = if current_user.present? | |
| service.join( | |
| :omniauth_hash => request.env['omniauth'], | |
| :user => current_user | |
| ) |