# Layout Confusion

**URL:** <https://www.ruby-forum.com/t/layout-confusion/168508>\
**Category:** Rails\
**Created:** [May 21, 2009, 4:49pm UTC](https://www.ruby-forum.com/t/layout-confusion/168508 "2009-05-21T16:49:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![JannaB](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/df788c/32.png) [@JannaB](https://www.ruby-forum.com/u/JannaB)\
**Post date:** [May 21, 2009, 4:49pm UTC](https://www.ruby-forum.com/t/layout-confusion/168508/1 "2009-05-21T16:49:43Z")

</div>

I am using AuthLogic and ActiveScaffold together in a Rails App.  
Essentailly, through AuthLogic (using Railscast 167 tutorial) I create  
a username/password signon screen, which has a link in the upper right  
to allow one to Register should they not presently posses a username/  
password. Very straightforward. If they click to Register, it takes  
then to associate/edit/.

Here is how my associate/edit/id looks

[![](http://www.parametricplanet.com/edit0.JPG) ](http://www.parametricplanet.com/edit0.JPG)

note that this is rendered from erb’s in the views/associate  
directory, inside of /views/layouts/application.html.erb.

Note that I am using Active Scaffold.  
Here is how it looks when displayed from within the edit functionality  
of active\_scaffold:

[![](http://www.parametricplanet.com/edit.JPG) ](http://www.parametricplanet.com/edit.JPG)

Notice that the “Register | Login” and copyright notice are  
incorporated into the inner edit form, because of /views/layouts/  
application.html.erb. How can I set things up so that the inner form,  
for editing or creating a record, does not do this?

here is my associate\_controller.rb :

class AssociateController \< ApplicationController  
layout “application.html.erb”

active\_scaffold :associate do |config|  
config.label = “Associates”  
config.list.columns =  
[:lastname, :firstname, :username, :email, :branch]  
#list.columns.exclude :comments  
config.columns[:state].form\_ui = :usa\_state  
config.columns[:country].form\_ui = :country  
list.sorting = {:lastname =\> ‘ASC’}  
config.actions.exclude :show #, :delete  
config.actions.swap :search, :live\_search

```
end

    def new
        @associate = Associate.new
      end

      def create
        @associate = Associate.new(params[:associate])
        if @associate.save
          flash[:notice] = "Registration successful."
          redirect_to root_url
        else
          render :action => 'new'
        end
      end

      def edit
        @associate = Associate.find(params[:id])#current_associate
      end

      def update
        @associate = Associate.find(params[:id])#current_associate
        if @associate.update_attributes(params[:associate])
          flash[:notice] = "Successfully updated profile."
          redirect_to root_url
        else
          render :action => 'edit'
        end
      end

```

end

here is my /views/layouts/application.html.erb :

//  
//   
// \<%= javascript\_include\_tag :defaults %\>  
// \<%= active\_scaffold\_includes %\>  
// \<%= h(yield(:title) || @page\_title ||“Untitled”) %\>\</  
title\>  
// \<%= stylesheet\_link\_tag ‘application’ %\>  
// \<%= yield(:head) %\>  
//   
//   
//

  
// 
  
// \<% if current\_associate %\>  
// \<%= link\_to “Edit Profile”, edit\_associate\_path(:current)  
%\> |  
// \<%= link\_to “Logout”, logout\_path %\>  
// \<% else %\>  
// \<%= link\_to “Register”, :controller =\>  
“associate”, :action =\> “new” %\> |  
// \<%= link\_to “Login”, login\_path %\>  
// \<% end %\>  
// 

// \<% flash.each do |name, msg| %\>  
// \<%= content\_tag :div, msg, :id =\> “flash\_#{name}” %\>  
// \<% end %\>

// \<% if show\_title? %\>  
//

# \<%=h yield(:title) %\>
  
// \<% end %\>

// \<%= yield %\>/  
//

  
// 

Copyright © 2009/

  
//   
//

>
