<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Software and Technology Ramblings &#187; Rails</title>
	<atom:link href="http://blog.eastfacesoftware.com/category/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.eastfacesoftware.com</link>
	<description>A blog of software design, architecture, and other unread ramblings.</description>
	<lastBuildDate>Thu, 09 Dec 2010 17:01:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ruby Spreadsheet-Excel gem &#8211; 255 character limit</title>
		<link>http://blog.eastfacesoftware.com/2008/01/14/ruby-spreadsheet-excel-gem-255-character-limit/</link>
		<comments>http://blog.eastfacesoftware.com/2008/01/14/ruby-spreadsheet-excel-gem-255-character-limit/#comments</comments>
		<pubDate>Mon, 14 Jan 2008 19:28:55 +0000</pubDate>
		<dc:creator>Doug Hays</dc:creator>
				<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://blog.eastfacesoftware.com/2008/01/14/ruby-spreadsheet-excel-gem-255-character-limit/</guid>
		<description><![CDATA[A client of mine let me know today that the Excel spreadsheets I was generating for them had data truncated at 255 characters. I didn&#8217;t find anything on the web that gave a reason or offered a fix so I decided to dig into the code myself.  I am using the Ruby Spreadsheet-Excel gem.
Sure [...]]]></description>
			<content:encoded><![CDATA[<p>A client of mine let me know today that the Excel spreadsheets I was generating for them had data truncated at 255 characters. I didn&#8217;t find anything on the web that gave a reason or offered a fix so I decided to dig into the code myself.  I am using the <a href="http://rubyforge.org/projects/spreadsheet/" target="_blank">Ruby Spreadsheet-Excel</a> gem.</p>
<p>Sure enough, on line 289, of workbook.rb (v0.3.5.1), there was this: </p>
<pre style="background-color:#e5e5e5; border: 1px solid black; padding-left:5px;">
      # Truncate strings over 255 characters
      if strlen > StrMax
         str    = str[0..StrMax-1]
         length = 0x0008 + StrMax
         strlen = StrMax
      end
</pre>
<p>No idea why this was done and I wasn&#8217;t going to waste anytime considering the downsides of <i>not</i> truncating, so I commented this block out and it works fine.</p>
<p>Maybe it has something to do with an older version of Excel?  Who knows.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eastfacesoftware.com/2008/01/14/ruby-spreadsheet-excel-gem-255-character-limit/feed/</wfw:commentRss>
		<slash:comments>2098</slash:comments>
		</item>
		<item>
		<title>Integrating FCKEditor and ActiveScaffold</title>
		<link>http://blog.eastfacesoftware.com/2007/12/15/integrating-fckeditor-and-activescaffold/</link>
		<comments>http://blog.eastfacesoftware.com/2007/12/15/integrating-fckeditor-and-activescaffold/#comments</comments>
		<pubDate>Sat, 15 Dec 2007 06:35:23 +0000</pubDate>
		<dc:creator>Doug Hays</dc:creator>
				<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://blog.eastfacesoftware.com/2007/12/15/integrating-fckeditor-and-activescaffold/</guid>
		<description><![CDATA[I just solved an issue that I couldn&#8217;t find an answer for on the web, so I thought I&#8217;d just put it out there so that maybe it could help someone else.  I am creating a simple CMS tool for one of my clients and always like to use the FCKEditor for CMS tools. [...]]]></description>
			<content:encoded><![CDATA[<p>I just solved an issue that I couldn&#8217;t find an answer for on the web, so I thought I&#8217;d just put it out there so that maybe it could help someone else.  I am creating a simple CMS tool for one of my clients and always like to use the <a href="http://www.fckeditor.net/" target="_blank">FCKEditor</a> for CMS tools.  I hadn&#8217;t built such a thing in Rails before, nor had I used <a href="http://activescaffold.com/" target="_blank">ActiveScaffold</a> before today.  But <a href="http://www.rubyonrails.org" target="_blank">Rails</a> + ActiveScaffold + FCKEditor seemed like the perfect combination. And it is, once you get it working.  Here&#8217;s what I had to do to make this work for a table called content_items and a field called content.</p>
<p>
After installing the FCKEditor and ActiveScaffold plugins, I created, for the content column, a form column override file in my views/content_items directory called _content_form_column.rhtml.  After some trial and error, I landed at this solution:</p>
<pre style="background-color:#e5e5e5; border: 1px solid black; padding-left:5px;">
&lt;%=column.name.to_s.titleize %&gt;:

&lt;%= fckeditor_textarea( :record, column.name, :toolbarSet =&gt; 'Simple', :width =&gt; '100%', :height =&gt; '400px') %&gt;

&lt;input name="commit" type="submit" value="Save" class="submit"
	onClick="var oEditor = FCKeditorAPI.GetInstance('record_&lt;%=@record.id%&gt;_&lt;%=column.name%&gt;_editor');
        document.getElementById('record_&lt;%=@record.id%&gt;_&lt;%=column.name%&gt;_editor').value = oEditor.GetXHTML();" /&gt;
</pre>
<p>
Now, this is my 15-minute solution.  What I&#8217;d like to do is get that onClick JavaScript to fire on the form&#8217;s onSubmit event and remove this secondary submit button altogether.  But, since it&#8217;s late, I decided to remove the ActiveScaffold Update button and make this column the last on the page.  How&#8217;s that for an I&#8217;ll-deal-with-it-later hack!?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eastfacesoftware.com/2007/12/15/integrating-fckeditor-and-activescaffold/feed/</wfw:commentRss>
		<slash:comments>86</slash:comments>
		</item>
	</channel>
</rss>

