<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: RAILS PLUGIN: Ajax Scaffold File Upload plugin</title>
	<link>http://smoothrails.com/2007/01/29/rails-plugin-ajax-scaffold-file-upload-plugin/</link>
	<description>Ruby on Rails news resources and information RoR code snippets and help scripts for newbies.</description>
	<pubDate>Mon, 08 Sep 2008 11:10:14 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<item>
		<title>By: Jon</title>
		<link>http://smoothrails.com/2007/01/29/rails-plugin-ajax-scaffold-file-upload-plugin/#comment-29</link>
		<author>Jon</author>
		<pubDate>Mon, 12 Mar 2007 16:48:24 +0000</pubDate>
		<guid>http://smoothrails.com/2007/01/29/rails-plugin-ajax-scaffold-file-upload-plugin/#comment-29</guid>
		<description>Nice work, a real time saver! Much thanks!</description>
		<content:encoded><![CDATA[<p>Nice work, a real time saver! Much thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MeanderingCode</title>
		<link>http://smoothrails.com/2007/01/29/rails-plugin-ajax-scaffold-file-upload-plugin/#comment-15</link>
		<author>MeanderingCode</author>
		<pubDate>Sun, 04 Mar 2007 04:08:59 +0000</pubDate>
		<guid>http://smoothrails.com/2007/01/29/rails-plugin-ajax-scaffold-file-upload-plugin/#comment-15</guid>
		<description>It doesn't seem to be rendering partials correctly...could easily be a problem on my end, but...




 ActionView::ActionViewError in Content_pages#view_default

Showing app/views/layouts/application.rhtml where line #46 raised:

No rhtml, rxml, rjs or delegate template found for content_pages/_suckerfish in script/../config/../app/views

Extracted source (around line #46):

43:       &lt;!--%= render_component(:controller =&#62;--&gt; 'page/menubar', :action =&#62;
44:       'suckerfish') %--&#62;
45:        'menu_items/suckerfish',
46:           :locals =&#62; {:items =&#62; session[:menu].get_menu(0)} %&#62;
47:     
48:   
49: 

RAILS_ROOT: script/../config/..

Application Trace :

/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/base.rb:399:in `find_template_extension_for'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/base.rb:335:in `pick_template_extension'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/base.rb:249:in `render_file'
vendor/plugins/ajaxscaffoldp/lib/ajax_scaffold_plugin.rb:467:in `render'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/partials.rb:59:in `render_partial'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/benchmarking.rb:26:in `benchmark'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/1.8/benchmark.rb:307:in `realtime'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/benchmarking.rb:26:in `benchmark'
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/partials.rb:58:in `render_partial'
vendor/plugins/ajaxscaffoldp/lib/ajax_scaffold_plugin.rb:481:in `render'
#{RAILS_ROOT}/app/views/layouts/application.rhtml:46:in `_run_rhtml_47app47views47layouts47application46rhtml'




It should look for _suckerfish.rhtml in the app/views/menu_items folder, but it's looking in the app/views/content_pages folder...I think it has to do with the parse_partial_path method on line 488 of vendor/plugins/ajaxscaffoldp/lib/ajax_scaffold_plugin.rb (called from the render method living right before it in the code), but this doesn't happen before install / after remove of ajaxscaffoldp_upload.


Could this have to do with being in an iframe?  I'm pretty new to all this, so...


Thanks for anyone's thoughts.</description>
		<content:encoded><![CDATA[<p>It doesn&#8217;t seem to be rendering partials correctly&#8230;could easily be a problem on my end, but&#8230;</p>
<p> ActionView::ActionViewError in Content_pages#view_default</p>
<p>Showing app/views/layouts/application.rhtml where line #46 raised:</p>
<p>No rhtml, rxml, rjs or delegate template found for content_pages/_suckerfish in script/../config/../app/views</p>
<p>Extracted source (around line #46):</p>
<p>43:       <!--%= render_component(:controller =&gt;--> &#8216;page/menubar&#8217;, :action =&gt;<br />
44:       &#8217;suckerfish&#8217;) %&#8211;&gt;<br />
45:        &#8216;menu_items/suckerfish&#8217;,<br />
46:           :locals =&gt; {:items =&gt; session[:menu].get_menu(0)} %&gt;<br />
47:<br />
48:<br />
49: </p>
<p>RAILS_ROOT: script/../config/..</p>
<p>Application Trace :</p>
<p>/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/base.rb:399:in `find_template_extension_for&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/base.rb:335:in `pick_template_extension&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/base.rb:249:in `render_file&#8217;<br />
vendor/plugins/ajaxscaffoldp/lib/ajax_scaffold_plugin.rb:467:in `render&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/partials.rb:59:in `render_partial&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/benchmarking.rb:26:in `benchmark&#8217;<br />
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure&#8217;<br />
/usr/lib/ruby/1.8/benchmark.rb:307:in `realtime&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_controller/benchmarking.rb:26:in `benchmark&#8217;<br />
/usr/lib/ruby/gems/1.8/gems/actionpack-1.13.2/lib/action_view/partials.rb:58:in `render_partial&#8217;<br />
vendor/plugins/ajaxscaffoldp/lib/ajax_scaffold_plugin.rb:481:in `render&#8217;<br />
#{RAILS_ROOT}/app/views/layouts/application.rhtml:46:in `_run_rhtml_47app47views47layouts47application46rhtml&#8217;</p>
<p>It should look for _suckerfish.rhtml in the app/views/menu_items folder, but it&#8217;s looking in the app/views/content_pages folder&#8230;I think it has to do with the parse_partial_path method on line 488 of vendor/plugins/ajaxscaffoldp/lib/ajax_scaffold_plugin.rb (called from the render method living right before it in the code), but this doesn&#8217;t happen before install / after remove of ajaxscaffoldp_upload.</p>
<p>Could this have to do with being in an iframe?  I&#8217;m pretty new to all this, so&#8230;</p>
<p>Thanks for anyone&#8217;s thoughts.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: StuartD</title>
		<link>http://smoothrails.com/2007/01/29/rails-plugin-ajax-scaffold-file-upload-plugin/#comment-9</link>
		<author>StuartD</author>
		<pubDate>Fri, 16 Feb 2007 08:00:07 +0000</pubDate>
		<guid>http://smoothrails.com/2007/01/29/rails-plugin-ajax-scaffold-file-upload-plugin/#comment-9</guid>
		<description>Excellent work - this is exactly what I'm looking for - have you thought about getting this working with edge?</description>
		<content:encoded><![CDATA[<p>Excellent work - this is exactly what I&#8217;m looking for - have you thought about getting this working with edge?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gary</title>
		<link>http://smoothrails.com/2007/01/29/rails-plugin-ajax-scaffold-file-upload-plugin/#comment-7</link>
		<author>Gary</author>
		<pubDate>Fri, 09 Feb 2007 15:25:16 +0000</pubDate>
		<guid>http://smoothrails.com/2007/01/29/rails-plugin-ajax-scaffold-file-upload-plugin/#comment-7</guid>
		<description>This may be a silly question but how do I mark a database field to be a file upload?</description>
		<content:encoded><![CDATA[<p>This may be a silly question but how do I mark a database field to be a file upload?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: YodaYid</title>
		<link>http://smoothrails.com/2007/01/29/rails-plugin-ajax-scaffold-file-upload-plugin/#comment-6</link>
		<author>YodaYid</author>
		<pubDate>Fri, 09 Feb 2007 13:38:24 +0000</pubDate>
		<guid>http://smoothrails.com/2007/01/29/rails-plugin-ajax-scaffold-file-upload-plugin/#comment-6</guid>
		<description>This is my (quick) fix, which seems to work for me so far:

      if partial_path.include?('/')
        if (erb_template_exists?("#{path}/_#{partial_name}"))
          #path, partial_name = partial_pieces(partial_name)
          return "#{path}/#{partial_name}"
        else
          path, partial_name = partial_pieces(partial_name)
          if (erb_template_exists?("#{path}/_#{partial_name}"))
            return "#{path}/#{partial_name}"
          end
        end
      end


Hopefully I got the formatting right this time :-P</description>
		<content:encoded><![CDATA[<p>This is my (quick) fix, which seems to work for me so far:</p>
<p>      if partial_path.include?(&#8217;/')<br />
        if (erb_template_exists?(&#8221;#{path}/_#{partial_name}&#8221;))<br />
          #path, partial_name = partial_pieces(partial_name)<br />
          return &#8220;#{path}/#{partial_name}&#8221;<br />
        else<br />
          path, partial_name = partial_pieces(partial_name)<br />
          if (erb_template_exists?(&#8221;#{path}/_#{partial_name}&#8221;))<br />
            return &#8220;#{path}/#{partial_name}&#8221;<br />
          end<br />
        end<br />
      end</p>
<p>Hopefully I got the formatting right this time <img src='http://smoothrails.com/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: YodaYid</title>
		<link>http://smoothrails.com/2007/01/29/rails-plugin-ajax-scaffold-file-upload-plugin/#comment-5</link>
		<author>YodaYid</author>
		<pubDate>Fri, 09 Feb 2007 13:28:19 +0000</pubDate>
		<guid>http://smoothrails.com/2007/01/29/rails-plugin-ajax-scaffold-file-upload-plugin/#comment-5</guid>
		<description>Very nice :-)

I do have one issue though - this piece of code seems to be breaking my shared partials:
&lt;code&gt;
      if partial_path.include?('/')
        if (erb_template_exists?("#{path}/_#{partial_name}"))
          path, partial_name = partial_pieces(partial_name)
          return "#{path}/#{partial_name}"
        end
      end
&lt;/code&gt;

I do have an slightly unusual situation - most of my controllers are in an 'admin' directory (e.g. 'admin/products'), and the shared templates are simply under 'admin'.

The result is this:
render :partial =&#62; 'admin/header'
results in
No rhtml, rxml, rjs or delegate template found for admin/products/_header in ./script/../config/../app/views

Can I safely remove the section of code I pasted above?

Thanks,
--YY</description>
		<content:encoded><![CDATA[<p>Very nice <img src='http://smoothrails.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I do have one issue though - this piece of code seems to be breaking my shared partials:<br />
<code><br />
      if partial_path.include?('/')<br />
        if (erb_template_exists?("#{path}/_#{partial_name}"))<br />
          path, partial_name = partial_pieces(partial_name)<br />
          return "#{path}/#{partial_name}"<br />
        end<br />
      end<br />
</code></p>
<p>I do have an slightly unusual situation - most of my controllers are in an &#8216;admin&#8217; directory (e.g. &#8216;admin/products&#8217;), and the shared templates are simply under &#8216;admin&#8217;.</p>
<p>The result is this:<br />
render :partial =&gt; &#8216;admin/header&#8217;<br />
results in<br />
No rhtml, rxml, rjs or delegate template found for admin/products/_header in ./script/../config/../app/views</p>
<p>Can I safely remove the section of code I pasted above?</p>
<p>Thanks,<br />
&#8211;YY</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Curtis</title>
		<link>http://smoothrails.com/2007/01/29/rails-plugin-ajax-scaffold-file-upload-plugin/#comment-4</link>
		<author>Curtis</author>
		<pubDate>Mon, 29 Jan 2007 14:36:48 +0000</pubDate>
		<guid>http://smoothrails.com/2007/01/29/rails-plugin-ajax-scaffold-file-upload-plugin/#comment-4</guid>
		<description>This is great!  Thanks!</description>
		<content:encoded><![CDATA[<p>This is great!  Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
