Changeset 1940
- Timestamp:
- 07/27/05 11:44:18 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/lib/action_controller/scaffolding.rb
r1614 r1940 147 147 148 148 private 149 def render#{suffix}_scaffold(action = caller_method_name(caller)) 149 def render#{suffix}_scaffold(action=nil) 150 action ||= caller_method_name(caller) 151 # logger.info ("testing template:" + "\#{self.class.controller_path}/\#{action}") if logger 152 150 153 if template_exists?("\#{self.class.controller_path}/\#{action}") 151 render (:action =>action)154 render_action(action) 152 155 else 153 156 @scaffold_class = #{class_name} … … 156 159 add_instance_variables_to_assigns 157 160 158 @ content_for_layout = @template.render_file(scaffold_path(action.sub(/#{suffix}$/, "")), false)161 @template.instance_variable_set("@content_for_layout", @template.render_file(scaffold_path(action.sub(/#{suffix}$/, "")), false)) 159 162 160 163 if !active_layout.nil? 161 render :file => active_layout, :use_full_path => true164 render_file(active_layout, nil, true) 162 165 else 163 render :file => scaffold_path("layout")166 render_file(scaffold_path("layout")) 164 167 end 165 168 end trunk/actionpack/lib/action_controller/templates/scaffolds/list.rhtml
r1404 r1940 15 15 <td><%= link_to "Show", :action => "show#{@scaffold_suffix}", :id => entry %></td> 16 16 <td><%= link_to "Edit", :action => "edit#{@scaffold_suffix}", :id => entry %></td> 17 <td><%= link_to "Destroy", :action => "destroy#{@scaffold_suffix}", :id => entry, :confirm => "Are you sure?"%></td>17 <td><%= link_to "Destroy", {:action => "destroy#{@scaffold_suffix}", :id => entry}, {:confirm => "Are you sure?"} %></td> 18 18 </tr> 19 19 <% end %>