Resting Pug logo Resting Pug

Description

Returns a symbol out of the subject model name

Tip

Override this method to get another root for params and JSON responses.

Used in

Use

Example

class BooksController < ApplicationController
  include RestingPug::Base

  private
  # Override a subject_model to use :novel as a symbol used in params and rendering
  def subject_model_sym
    :novel
  end
end

Source code

# lib/resting_pug/subject.rb

def subject_model_sym
  subject_model.to_s.underscore.to_sym
end
Find me on GitHub