Note that there are some explanatory texts on larger screens.

plurals
  1. POLayout render only when I write render :layout => 'application' on every resource
    primarykey
    data
    text
    <p>Code: <a href="https://github.com/werner/inmailing" rel="nofollow">https://github.com/werner/inmailing</a>, I'm trying to use inheritance in a controller, but for some reason layout works this way, I guess I'm doing something wrong, but I can't see it.</p> <pre><code>class StandardController &lt; ApplicationController attr_accessor :model, :url handles_sortable_columns def index @records = @model.all @q = model.search params[:q] @records = @q.result(:distinct =&gt; true).order(sortable_column_order).paginate(:page =&gt; params[:page], :per_page=&gt;10) #I'm not sure why I have to do this on every method #but if I don't rails doesn't recognize layout render :layout =&gt; 'application' end def new @record = @model.new render :layout =&gt; 'application' end def edit @record = @model.find(params[:id]) render :layout =&gt; 'application' end def show @record = @model.find(params[:id]) render :layout =&gt; 'application' end def create @record = @model.new(params[@model.to_s.downcase]) respond_to do |format| if @record.save format.html { redirect_to @url, notice: 'Successfully created.' } else format.html { render action: "new" } end end end def update @record = @model.find(params[:id]) respond_to do |format| if @record.update_attributes(params[@model.to_s.downcase]) format.html { redirect_to @url, notice: 'Successfully updated.' } else format.html { render action: "edit" } end end end def destroy @record = @model.find(params[:id]) @record.destroy respond_to do |format| format.html { redirect_to @url } end end end class DepartmentsController &lt; StandardController before_filter do @url = departments_url @edit_record_path = lambda {|record| edit_department_path(record) } @new_record_path = new_department_path @title = "Departments" end def initialize @model = Department end end </code></pre> <p>Layout:</p> <pre><code>!!! XML !!! %html %head %title Inmailing = stylesheet_link_tag 'application' = stylesheet_link_tag 'blueprint/screen.css', :media =&gt; 'screen, projection' = stylesheet_link_tag 'blueprint/print.css', :media =&gt; 'print' /[if IE] = stylesheet_link_tag 'blueprint/ie.css', :media =&gt; 'screen, projection' = csrf_meta_tags %body = yield = javascript_include_tag 'application' </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload