<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-1507274828812671052</atom:id><lastBuildDate>Fri, 01 Nov 2024 11:57:02 +0000</lastBuildDate><category>rails</category><category>ruby</category><category>rubyonrailstalk</category><category>PATH</category><category>ubuntu</category><title>rubyonrailsin</title><description></description><link>http://rubyonrailsin.blogspot.com/</link><managingEditor>noreply@blogger.com (Sandip Ransing)</managingEditor><generator>Blogger</generator><openSearch:totalResults>1244</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-5328023365164456257</guid><pubDate>Sat, 03 Apr 2010 02:26:00 +0000</pubDate><atom:updated>2010-04-02T19:34:26.203-07:00</atom:updated><title>[Rails] Re: App_Controller and partial issues with has_many through</title><description>When inspecting it I get [#,#,#,#]  and my title reads &amp;quot;Your Interests &lt;br&gt;(4)&amp;quot; and the print out is&lt;br&gt;#&lt;br&gt;#&lt;br&gt;#&lt;br&gt;#&lt;p&gt;What is # all about?  Is that an object filled with objects?&lt;p&gt;&lt;p&gt;&lt;br&gt;Colin Law wrote:&lt;br&gt;&amp;gt; On 2 April 2010 15:07, Jason Newport &amp;lt;&lt;a href=&quot;mailto:lists@ruby-forum.com&quot;&gt;lists@ruby-forum.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt;&amp;gt; class ApplicationController &amp;lt; ActionController::Base&lt;br&gt;&amp;gt;&amp;gt; �end&lt;br&gt;&amp;gt;&amp;gt; � �&amp;lt;% @user_interests.each do |interest| -%&amp;gt;&lt;br&gt;&amp;gt;&amp;gt;&lt;br&gt;&amp;gt;&amp;gt; seems to be counting the number of posts on the specific pages (index or&lt;br&gt;&amp;gt;&amp;gt; show) and totaling those up as a users interests. �And if for one user I&lt;br&gt;&amp;gt;&amp;gt; add two interests and view the single post page then the title will read&lt;br&gt;&amp;gt;&amp;gt; &amp;quot;You have 3 interests&amp;quot;, thus counts the two interests I really am&lt;br&gt;&amp;gt;&amp;gt; interested in plus the one for the Post page I am even though I have yet&lt;br&gt;&amp;gt;&amp;gt; to click/select it as an interest.&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; I would suggest installing ruby-debug, then you can break into the&lt;br&gt;&amp;gt; controller or the view and inspect the variables and work out what is&lt;br&gt;&amp;gt; going wrong.&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; See the rails guide on debugging at &lt;a href=&quot;http://guides.rubyonrails.org/&quot;&gt;http://guides.rubyonrails.org/&lt;/a&gt;&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; Colin&lt;p&gt;-- &lt;br&gt;Posted via &lt;a href=&quot;http://www.ruby-forum.com/&quot;&gt;http://www.ruby-forum.com/&lt;/a&gt;.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/rails-re-appcontroller-and-partial.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-8783208036200285451</guid><pubDate>Sat, 03 Apr 2010 02:25:00 +0000</pubDate><atom:updated>2010-04-02T19:25:35.667-07:00</atom:updated><title>[Rails] Re: Need help with find</title><description>Finally figured out something that worked.&lt;p&gt;@club = Club.find(params[:club_id])&lt;br&gt; ids = @club.members.connection.select_values(&amp;#39;SELECT person_id FROM&lt;br&gt;members&amp;#39;)&lt;br&gt; @people = Person.all(:order =&amp;gt; &amp;#39;name_sort&amp;#39;,&lt;br&gt;                                     :conditions =&amp;gt; [&amp;quot;id NOT IN (?)&amp;quot;,&lt;br&gt;ids])&lt;p&gt;Any comments or better methods.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/rails-re-need-help-with-find.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-22560266871391049</guid><pubDate>Sat, 03 Apr 2010 02:07:00 +0000</pubDate><atom:updated>2010-04-02T19:08:23.224-07:00</atom:updated><title>[Rails] GurusQ: Metal calling disparity-How to install metal in code</title><description>I have a simple class that I want to install as Rails Metal. I don&amp;#39;t&lt;br&gt;want to put it into a file in app/metal for reasons I don&amp;#39;t want to go&lt;br&gt;into. It looks like this, and handler is defined elsewhere.&lt;p&gt;class UrlFilter&lt;br&gt;  ALLOW = [404]&lt;br&gt;  DENY = [403]&lt;br&gt;  def self.call(env)&lt;br&gt;    handler.call(env[&amp;quot;PATH_INFO&amp;quot;]) ? ALLOW : DENY&lt;br&gt;  end&lt;br&gt;end&lt;p&gt;I&amp;#39;ve tried installing it like this :&lt;br&gt;ActionController::Dispatcher.middleware.use UrlFilter&lt;p&gt;but on the first request it crashes with :&lt;p&gt;Sat Apr 03 00:29:43 +0800 2010: Read error: #&amp;lt;ArgumentError: wrong&lt;br&gt;number of arguments (0 for 1)&amp;gt;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:31:in&lt;br&gt;`call&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:31:in&lt;br&gt;`klass&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:42:in&lt;br&gt;`active?&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:112:in&lt;br&gt;`active&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:108:in&lt;br&gt;`find_all&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:112:in&lt;br&gt;`each&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:112:in&lt;br&gt;`find_all&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:112:in&lt;br&gt;`active&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/middleware_stack.rb:116:in&lt;br&gt;`build&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:130:in&lt;br&gt;`build_middleware_stack&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:113:in&lt;br&gt;`call&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:34:in&lt;br&gt;`run&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:108:in&lt;br&gt;`call&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/rails/rack/static.rb:31:in&lt;br&gt;`call&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:46:in `call&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `each&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in `call&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/rails/rack/log_tailer.rb:17:in&lt;br&gt;`call&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/content_length.rb:13:in&lt;br&gt;`call&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/chunked.rb:15:in `call&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:64:in&lt;br&gt;`process&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in&lt;br&gt;`process_client&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in&lt;br&gt;`process_client&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in&lt;br&gt;`initialize&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in&lt;br&gt;`initialize&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:34:in&lt;br&gt;`run&amp;#39;&lt;br&gt;/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:111&lt;br&gt;/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in&lt;br&gt;`gem_original_require&amp;#39;&lt;br&gt;/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require&amp;#39;&lt;br&gt;script/server:3&lt;p&gt;The rails calling code looks like this :&lt;p&gt;      def klass&lt;br&gt;        if @klass.respond_to?(:call)&lt;br&gt;          @klass.call&lt;br&gt;        elsif @klass.is_a?(Class)&lt;br&gt;          @klass&lt;br&gt;        else&lt;br&gt;          @klass.to_s.constantize&lt;br&gt;        end&lt;br&gt;      rescue NameError&lt;br&gt;        @klass&lt;br&gt;      end&lt;p&gt;      def active?&lt;br&gt;        return false unless klass&lt;p&gt;        if @conditional.respond_to?(:call)&lt;br&gt;          @conditional.call&lt;br&gt;        else&lt;br&gt;          @conditional&lt;br&gt;        end&lt;br&gt;      end&lt;p&gt;Notice when calling call no arguments are passed (twice!) ? Every metal&lt;br&gt;example I&amp;#39;ve seen defines the entry method as&lt;p&gt;  def self.call(env)&lt;p&gt;yet this calling code doesn&amp;#39;t pass any.&lt;p&gt;Whats going on ? How do I define and install a metal class in code ?&lt;br&gt;-- &lt;br&gt;Posted via &lt;a href=&quot;http://www.ruby-forum.com/&quot;&gt;http://www.ruby-forum.com/&lt;/a&gt;.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/rails-gurusq-metal-calling-disparity.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-493149370388895670</guid><pubDate>Sat, 03 Apr 2010 01:57:00 +0000</pubDate><atom:updated>2010-04-02T18:58:03.683-07:00</atom:updated><title>[Rails] Re: Rails cascading delete</title><description>Thanks all. Destroy worked great!,&lt;p&gt;Thanks&lt;br&gt;Hila;&lt;p&gt;&lt;br&gt;On Apr 2, 2:41&amp;#160;am, Lasse Bunk &amp;lt;&lt;a href=&quot;mailto:lasseb...@gmail.com&quot;&gt;lasseb...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; Hi Hilal,&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; You need to use :dependent =&amp;gt; :destroy instead of :delete_all because&lt;br&gt;&amp;gt; :delete_all doesn&amp;#39;t fire any callbacks. That&amp;#39;s why it only deletes one&lt;br&gt;&amp;gt; level.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; /Lasse&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; 2010/4/2 Hilal &amp;lt;&lt;a href=&quot;mailto:hilal.sha...@gmail.com&quot;&gt;hilal.sha...@gmail.com&lt;/a&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; Hello There:&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; &amp;#160;I am trying to do a deep cascading deletes in rails.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; The schema looks like this:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; Blogs (has many) entries ( has many ) comments&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; A blog has n entries, an entry has n comments.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; So, in my Blog model I use&lt;br&gt;&amp;gt; &amp;gt; has_many :entries, :dependent =&amp;gt; :delete_all&lt;br&gt;&amp;gt; &amp;gt; and in my Entry model I use&lt;br&gt;&amp;gt; &amp;gt; has_many :comments,:dependent =&amp;gt; :delete_all&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; The problem I am having is that deleting blogs, will only delete&lt;br&gt;&amp;gt; &amp;gt; entries, but will not delete comments. In other words, the cascading&lt;br&gt;&amp;gt; &amp;gt; delete isn&amp;#39;t deep?&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; Am I doing something wrong here?&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; Thanks&lt;br&gt;&amp;gt; &amp;gt; Hilal&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; --&lt;br&gt;&amp;gt; &amp;gt; You received this message because you are subscribed to the Google Groups&lt;br&gt;&amp;gt; &amp;gt; &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;&amp;gt; &amp;gt; To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;&amp;gt; &amp;gt; To unsubscribe from this group, send email to&lt;br&gt;&amp;gt; &amp;gt; &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;&amp;lt;&lt;a href=&quot;mailto:rubyonrails-talk%252Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk%2Bunsubscribe@googlegroups.com&lt;/a&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; .&lt;br&gt;&amp;gt; &amp;gt; For more options, visit this group at&lt;br&gt;&amp;gt; &amp;gt;&lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/rails-re-rails-cascading-delete.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-2175533519928340412</guid><pubDate>Sat, 03 Apr 2010 01:30:00 +0000</pubDate><atom:updated>2010-04-02T18:31:22.059-07:00</atom:updated><title>[Rails] Using Builders</title><description>I am using RoR 2.3, and have installed the builder gem&lt;p&gt;I have a line in a view as follows:&lt;p&gt;	str_xml = render &amp;quot;fusioncharts/array_example/ss_array_data.builder&amp;quot;,&lt;br&gt;{:arr_data =&amp;gt; @arr_data}&lt;p&gt;Which does not set str_xml to anything.&lt;p&gt;I can confirm that in my controller I have @arr_data set up and&lt;br&gt;populated properly. (And in my controller, I have   require &amp;#39;builder&amp;#39;&lt;br&gt;at the top)&lt;p&gt;In my views folder, I have a folder set up under it as &amp;quot;fusioncharts/&lt;br&gt;array_example/&amp;quot; and the file ss_array_data.builder. (However, this may&lt;br&gt;be why str_xml is not being set -- when I go to the URL which would&lt;br&gt;invoke this view, I get &amp;quot;Missing template _ss_array_data.builder in&lt;br&gt;view path...&amp;quot; It will only render the page if I put the underscore&lt;br&gt;before the filename ss_array_data.builder, making it a partial).&lt;p&gt;What am I not understanding about builders that I cannot convert my&lt;br&gt;array @arr_data to str_xml ?&lt;p&gt;Thanks so much, RVince&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/rails-using-builders.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-1963303645438709641</guid><pubDate>Sat, 03 Apr 2010 01:28:00 +0000</pubDate><atom:updated>2010-04-02T18:29:14.023-07:00</atom:updated><title>Re: [spree-user] Re: User Personalisation of Products</title><description>A quick browse through your code shows that you can set options for a&lt;br&gt;product, but where were you planning on storing the information from&lt;br&gt;the user?  I don&amp;#39;t see any changes to the line_items table (or a&lt;br&gt;separate table), etc to store the personalization input from the user.&lt;p&gt;It also appears that each product can only have a single&lt;br&gt;personalization option.  Is this your goal?&lt;p&gt;I have the need for something similar, but I need multiple&lt;br&gt;personalization options per product, and it needs to support more&lt;br&gt;options than a single text field (some &amp;quot;personalization&amp;quot; needs to be&lt;br&gt;radio buttons, select boxes, etc).&lt;p&gt;I would also merge your migrations right now while nobody is really&lt;br&gt;using the code.  The way your migrations are currently written, if&lt;br&gt;someone was using a version that used the :personalisation_options&lt;br&gt;column inside products or variants, those changes would be lost when&lt;br&gt;you ran the 20100320220929_add_personalisable.rb migration since you&lt;br&gt;don&amp;#39;t alter the name of the column, you drop it then re-create it.  Of&lt;br&gt;course during the drop you lose any data that was entered by the admin&lt;br&gt;in that column.  I assume that you are making the assumption that&lt;br&gt;nobody is using that previous version so it is ok to make the drop,&lt;br&gt;but if that&amp;#39;s the case then you may as well clean up the migrations to&lt;br&gt;create the proper column to begin with. (Just my $0.02 on the&lt;br&gt;migrations)&lt;p&gt;-Chris&lt;p&gt;&lt;p&gt;On Sat, Apr 3, 2010 at 6:24 AM, peachygifts &amp;lt;&lt;a href=&quot;mailto:m.ward@leythers.com&quot;&gt;m.ward@leythers.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; The admin side of my extension is now working: an admin can set a&lt;br&gt;&amp;gt; product to be personalisable, and can then set personalisation options&lt;br&gt;&amp;gt; against a product.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Now I would like to display these results of these options to&lt;br&gt;&amp;gt; customers:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; The product has a personalisable? attribute. The product may also have&lt;br&gt;&amp;gt; many personalisation_options associated with it. Each&lt;br&gt;&amp;gt; personalisation_option has name, title and max_length&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Step 1 now has me a little flummoxed: I need to build fields on the&lt;br&gt;&amp;gt; product page for each personalisation_option associated with a&lt;br&gt;&amp;gt; product, rendered as a label with title as its contents, and a text&lt;br&gt;&amp;gt; field that limits to the number of character specified in max_length.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; How do I go about this in spree / rails?&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; For anyone interested in helping, the current extension can be found&lt;br&gt;&amp;gt; in its current gestation at git://&lt;a href=&quot;http://github.com/peachygifts/spree-personalisation.git&quot;&gt;github.com/peachygifts/spree-personalisation.git&lt;/a&gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Thanks for your help!&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Michael&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; --&lt;br&gt;&amp;gt; You received this message because you are subscribed to the Google Groups &amp;quot;Spree&amp;quot; group.&lt;br&gt;&amp;gt; To post to this group, send email to &lt;a href=&quot;mailto:spree-user@googlegroups.com&quot;&gt;spree-user@googlegroups.com&lt;/a&gt;.&lt;br&gt;&amp;gt; To unsubscribe from this group, send email to &lt;a href=&quot;mailto:spree-user%2Bunsubscribe@googlegroups.com&quot;&gt;spree-user+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;&amp;gt; For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/spree-user?hl=en&quot;&gt;http://groups.google.com/group/spree-user?hl=en&lt;/a&gt;.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Spree&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:spree-user@googlegroups.com&quot;&gt;spree-user@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:spree-user%2Bunsubscribe@googlegroups.com&quot;&gt;spree-user+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/spree-user?hl=en&quot;&gt;http://groups.google.com/group/spree-user?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/re-spree-user-re-user-personalisation.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-1632427363592004840</guid><pubDate>Sat, 03 Apr 2010 00:51:00 +0000</pubDate><atom:updated>2010-04-02T17:57:48.884-07:00</atom:updated><title>[Rails] Re: Best way of sorting/grouping objects</title><description>By any chance do you have a model named PageType? If you, you could&lt;br&gt;set up a relationship between PageType and Page:&lt;p&gt;page.rb:&lt;br&gt;belongs_to :page_type&lt;p&gt;page_type.rb:&lt;br&gt;has_many :pages&lt;p&gt;Then display it with:&lt;p&gt;your_controller.rb:&lt;br&gt;@page_types = PageType.all&lt;p&gt;your_view.html.haml (or .erb, etc.)&lt;br&gt;- @page_types.each do |page_type|&lt;br&gt;  %h1= &lt;a href=&quot;http://page_type.name&quot;&gt;page_type.name&lt;/a&gt;&lt;br&gt;  %ul&lt;br&gt;    = list_of page_type.pages do |page|&lt;br&gt;      = &lt;a href=&quot;http://page.name&quot;&gt;page.name&lt;/a&gt;&lt;p&gt;If you don&amp;#39;t already have a PageType model, or don&amp;#39;t want to introduce&lt;br&gt;another model, you could probably use:&lt;p&gt;@page_types = Page.all(:order =&amp;gt; &amp;#39;page_type&amp;#39;, :group =&amp;gt; &amp;#39;page_type&amp;#39;)&lt;p&gt;and then play around with the result of that. (At least I think that&amp;#39;s&lt;br&gt;correct… haha, sorry if it&amp;#39;s not)&lt;p&gt;Good luck,&lt;br&gt;Angelo&lt;p&gt;On Apr 2, 7:31&amp;#160;am, Brent &amp;lt;&lt;a href=&quot;mailto:wejrow...@gmail.com&quot;&gt;wejrow...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; That could work. But I need it to order by page_order also. &amp;#160;I would&lt;br&gt;&amp;gt; like to group them into 3 groups then sort them by that. In the end I&lt;br&gt;&amp;gt; want it to look something like this in html...&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; TYPE ONE&lt;br&gt;&amp;gt; Page 1&lt;br&gt;&amp;gt; Page 2&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; TYPE TWO&lt;br&gt;&amp;gt; Page 1&lt;br&gt;&amp;gt; Page 2&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Before I was doing something like this (I had an array of each page&lt;br&gt;&amp;gt; type called page_types):&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;lt;% page_types.each do |t| %&amp;gt;&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;lt;%= t %&amp;gt;&amp;#39;s&lt;br&gt;&amp;gt; &amp;#160; &amp;#160;&amp;lt;% Page.find(:all, :conditions=&amp;gt;{:page_type=&amp;gt;t}, :order=&amp;gt;position&lt;br&gt;&amp;gt; %&amp;gt;&lt;br&gt;&amp;gt; &amp;#160; &amp;#160; &amp;#160;etc.&lt;br&gt;&amp;gt; &amp;#160; &amp;lt;% end %&amp;gt;&lt;br&gt;&amp;gt; &amp;lt;% end %&amp;gt;&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/rails-re-best-way-of-sortinggrouping_6983.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-928795959804443787</guid><pubDate>Fri, 02 Apr 2010 23:53:00 +0000</pubDate><atom:updated>2010-04-02T17:21:09.054-07:00</atom:updated><title>[Rails] Re: &quot;new&quot; form as partial?</title><description>On Apr 2, 4:27&amp;#160;pm, Marian Steinbach &amp;lt;&lt;a href=&quot;mailto:marian.steinb...@gmail.com&quot;&gt;marian.steinb...@gmail.com&lt;/a&gt;&amp;gt;&lt;br&gt;wrote:&lt;p&gt;&amp;gt; Creating a certain type of database record is a very frequent task in&lt;br&gt;&amp;gt; my application (or at least it should be ;-)). So I want to be able to&lt;br&gt;&amp;gt; place the form for creating that database record in practically any&lt;br&gt;&amp;gt; view, not just the /mymodel/new view.&lt;p&gt;I&amp;#39;m sure you can refactor code to fit almost anything into a single&lt;br&gt;new/edit partial :)  But in my small experience the models are&lt;br&gt;different enough so that having different views for different models&lt;br&gt;makes the code more readable.  That said, I almost always share new&lt;br&gt;and edit for a model in a partial:&lt;p&gt;e.g. new.html.erb&lt;br&gt;&amp;lt;%= render( :partial =&amp;gt; &amp;quot;form&amp;quot;, :locals =&amp;gt; { :buttonname =&amp;gt; &amp;#39;Add&amp;#39; } )&lt;br&gt;%&amp;gt;&lt;p&gt;edit.html.erb&lt;br&gt;&amp;lt;%= render( :partial =&amp;gt; &amp;quot;form&amp;quot;, :locals =&amp;gt; { :buttonname =&amp;gt;&lt;br&gt;&amp;#39;Update&amp;#39; } ) %&amp;gt;&lt;p&gt;_form.html.erb&lt;br&gt;&amp;lt;%= error_message_on :lab, :base %&amp;gt;&lt;br&gt;&amp;lt;% form_for ..., do |f| %&amp;gt;&lt;br&gt;    &amp;lt;%= f.submit buttonname %&amp;gt;&lt;br&gt;...&lt;br&gt;&amp;lt;% end %&amp;gt;&lt;p&gt;Ryan Bates has great screencasts on this sort of thing, and I found&lt;br&gt;his Mastering Rails Forms &lt;a href=&quot;http://www.pragprog.com/screencasts/v-rbforms/mastering-rails-forms&quot;&gt;http://www.pragprog.com/screencasts/v-rbforms/mastering-rails-forms&lt;/a&gt;&lt;br&gt;($5 a video) to be a great start.&lt;p&gt;Craig&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/rails-re-new-form-as-partial.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-8953594534276444564</guid><pubDate>Fri, 02 Apr 2010 23:38:00 +0000</pubDate><atom:updated>2010-04-02T17:32:54.981-07:00</atom:updated><title>[Rails] Re: ScrAPI HTTPNoAccessError</title><description>I should also add -&lt;p&gt;Before I got the findurl method to just strip out any URLs with non &lt;br&gt;standard characters, I tried this line:&lt;p&gt;fullurl.gsub!(&amp;quot;,&amp;quot;,&amp;quot;%2C&amp;quot;)&lt;p&gt;Which replaced the commas with the URL friendlier code. This didn&amp;#39;t work &lt;br&gt;either, nor did putting the whole lot inside a CGI.escape(&amp;quot;&amp;quot;)&lt;p&gt;The scrAPI documentation isn&amp;#39;t particularly helpful in regards to what &lt;br&gt;format the URL needs to be in.&lt;br&gt;-- &lt;br&gt;Posted via &lt;a href=&quot;http://www.ruby-forum.com/&quot;&gt;http://www.ruby-forum.com/&lt;/a&gt;.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/rails-re-scrapi-httpnoaccesserror.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-5687664342987298336</guid><pubDate>Fri, 02 Apr 2010 23:37:00 +0000</pubDate><atom:updated>2010-04-02T16:38:20.775-07:00</atom:updated><title>[Rails] Re: Weird date/time incompatibility</title><description>On Apr 2, 6:05&amp;#160;pm, Craig White &amp;lt;&lt;a href=&quot;mailto:craigwh...@azapple.com&quot;&gt;craigwh...@azapple.com&lt;/a&gt;&amp;gt; wrote:&lt;p&gt;&amp;gt; they actually are in sync&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Fri Apr &amp;#160;2 17:13:05 CDT 2010 == 2010-04-02 22:13:05 (UTC) as CDT is UTC&lt;br&gt;&amp;gt; + 5 hours&lt;p&gt;Sorry for my sloppiness--I understand. I guess my main question is why&lt;br&gt;would it show the correct time in the view on one machine, but not&lt;br&gt;another?&lt;p&gt;datetime.strftime(&amp;quot;%A %B %d %Y %I:%M:%S %p&amp;quot;)&lt;p&gt;Is different for each machine.  I&amp;#39;m busily writing code to detect&lt;br&gt;where the user is, and adjusting the time shown in the view&lt;br&gt;accordingly, but I&amp;#39;m still mildly confused by why the two views show&lt;br&gt;differently.&lt;p&gt;Thanks,&lt;br&gt;Craig&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/rails-re-weird-datetime-incompatibility_2008.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-4094892434735352638</guid><pubDate>Fri, 02 Apr 2010 23:31:00 +0000</pubDate><atom:updated>2010-04-02T16:31:51.408-07:00</atom:updated><title>[Rails] ScrAPI HTTPNoAccessError</title><description>Hi,&lt;p&gt;I&amp;#39;m having some problems using scrAPI. I&amp;#39;m getting some&lt;br&gt;HTTPNoAccessErrors on certain urls.&lt;p&gt;The program searches a page (&lt;a href=&quot;http://en.wikiquote.org/wiki/List_of_films&quot;&gt;http://en.wikiquote.org/wiki/List_of_films&lt;/a&gt;)&lt;br&gt;for all of the links on it that go to pages with movie quotes on them.&lt;p&gt;It then loops through the list, pulling out the details from each page&lt;br&gt;using this method:&lt;p&gt;def self.scrapemovies&lt;br&gt;    Scraper::Base.parser :html_parser&lt;p&gt;    urlarray = Movie.findurls&lt;p&gt;    moviescraper = Scraper.define do&lt;br&gt;      process &amp;quot;h1&amp;quot;, :name =&amp;gt; :text&lt;br&gt;      process &amp;quot;p:nth-child(4)&amp;quot;, :description =&amp;gt; :text&lt;br&gt;      result :description, :name&lt;br&gt;    end&lt;p&gt;    urlarray.each do |url|&lt;br&gt;      fullurl = &amp;quot;&lt;a href=&quot;http://en.wikiquote.org#{url}&quot;&gt;http://en.wikiquote.org#{url}&lt;/a&gt;&amp;quot;&lt;br&gt;      movieurl = URI.parse(fullurl)&lt;br&gt;      data = moviescraper.scrape(movieurl)&lt;br&gt;      movie = Movie.new&lt;br&gt;      movie.url = fullurl&lt;br&gt;      &lt;a href=&quot;http://movie.name&quot;&gt;movie.name&lt;/a&gt; = &lt;a href=&quot;http://data.name&quot;&gt;data.name&lt;/a&gt;&lt;br&gt;      movie.description = data.description&lt;br&gt;      movie.save&lt;br&gt;    end&lt;br&gt;  end&lt;p&gt;&lt;br&gt;This worked ok until it got to&lt;br&gt;&lt;a href=&quot;http://en.wikiquote.org/wiki/20,000_Leagues_Under_the_Sea&quot;&gt;http://en.wikiquote.org/wiki/20,000_Leagues_Under_the_Sea&lt;/a&gt; which gave me&lt;br&gt;the http error because it had a comma in the URL.&lt;p&gt;I wrote a little bit of code in the Movie.findurl method that just&lt;br&gt;stripped out any URLs with commas or parentheses in as a bodge just to&lt;br&gt;get things working, but I&amp;#39;m even getting the error on this URL:&lt;br&gt;&lt;a href=&quot;http://en.wikiquote.org/wiki/27_Dresses&quot;&gt;http://en.wikiquote.org/wiki/27_Dresses&lt;/a&gt; which is very odd, because it&lt;br&gt;worked fine on the previous one which was :&lt;br&gt;&lt;a href=&quot;http://en.wikiquote.org/wiki/25th_Hour&quot;&gt;http://en.wikiquote.org/wiki/25th_Hour&lt;/a&gt;.&lt;p&gt;I can&amp;#39;t see the difference between them - I&amp;#39;ve tried manually visiting&lt;br&gt;the page, and it&amp;#39;s fine.&lt;p&gt;I&amp;#39;m assuming that I need to do some sort of cleverer parsing on the URLs&lt;br&gt;(so that I can include the ones with commas and parentheses too).&lt;p&gt;Is the Scraper::Base.parser :html_parser line got anything to do with&lt;br&gt;it? I couldn&amp;#39;t get the Tidy plugin to work properly, but I&amp;#39;m not sure&lt;br&gt;that it&amp;#39;s got anything to do with the URL parsing anyway.&lt;p&gt;I&amp;#39;m totally stuck - thanks in advance for any help.&lt;p&gt;Jules.&lt;br&gt;-- &lt;br&gt;Posted via &lt;a href=&quot;http://www.ruby-forum.com/&quot;&gt;http://www.ruby-forum.com/&lt;/a&gt;.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/rails-scrapi-httpnoaccesserror.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-1157713854829133687</guid><pubDate>Fri, 02 Apr 2010 23:05:00 +0000</pubDate><atom:updated>2010-04-02T16:05:59.480-07:00</atom:updated><title>Re: [Rails] Re: Weird date/time incompatibility</title><description>On Fri, 2010-04-02 at 15:28 -0700, Dudebot wrote:&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; On Apr 2, 3:12 pm, Colin Law &amp;lt;&lt;a href=&quot;mailto:clan...@googlemail.com&quot;&gt;clan...@googlemail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; &amp;gt; Am I right in assuming that is what is contained in the &amp;lt;a href link&lt;br&gt;&amp;gt; &amp;gt; in the html?  If so then the first thing is that they are in different&lt;br&gt;&amp;gt; &amp;gt; timezones.  Can you confirm that you are definitely seeing the above&lt;br&gt;&amp;gt; &amp;gt; dates with the same version of the code.  You said you had been&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; ...&lt;br&gt;&amp;gt; &amp;gt; Do you want to see a local time there or UTC?&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; Thanks again--the difference was that I had this in the development&lt;br&gt;&amp;gt; config/enviroment.rb&lt;br&gt;&amp;gt; config.time_zone = &amp;#39;UTC&amp;#39;&lt;br&gt;&amp;gt; But not in the production file.  I uncommented it in the production&lt;br&gt;&amp;gt; environment.rb just now, and lo and behold, that part is now working.&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; Except--I now remember I had in commented out of the production server&lt;br&gt;&amp;gt; as another part of the code which displays the &amp;quot;created at&amp;quot; field for&lt;br&gt;&amp;gt; a record was giving the wrong time.  E.g. if I run date in a terminal&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; I get Fri Apr  2 17:13:05 CDT 2010&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; (Which is my time)&lt;br&gt;&amp;gt; But for the created at for this record in the database I&amp;#39;m getting&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; 2010-04-02 22:13:33&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; I don&amp;#39;t seem to have that problem on my development machine (MacOS&lt;br&gt;&amp;gt; laptop).  The production server is a Redhat Linux machine.&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; Any idea how to &amp;quot;sync&amp;quot; created at and the system time on the&lt;br&gt;&amp;gt; production server?&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; Again, many TIA,&lt;br&gt;&amp;gt; Craig&lt;br&gt;----&lt;br&gt;they actually are in sync&lt;p&gt;Fri Apr  2 17:13:05 CDT 2010 == 2010-04-02 22:13:05 (UTC) as CDT is UTC&lt;br&gt;+ 5 hours&lt;p&gt;Craig&lt;p&gt;&lt;br&gt;-- &lt;br&gt;This message has been scanned for viruses and&lt;br&gt;dangerous content by MailScanner, and is&lt;br&gt;believed to be clean.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/re-rails-re-weird-datetime_02.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-8714049023032821457</guid><pubDate>Fri, 02 Apr 2010 22:53:00 +0000</pubDate><atom:updated>2010-04-02T16:01:52.408-07:00</atom:updated><title>[Rails] Re: HAS_MANY BELONGS_TO noobie question</title><description>bump... :) i really need help guys.&lt;p&gt;On Apr 2, 12:39&amp;#160;pm, David Zhu &amp;lt;&lt;a href=&quot;mailto:dzwestwindso...@gmail.com&quot;&gt;dzwestwindso...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt; Oh, thanks that relaly helped, but one more thing-&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; If i assigned posts to anotherposts, through a has_many :anotherposts&lt;br&gt;&amp;gt; and belongs_to :posts relationship, how would i do @post =&lt;br&gt;&amp;gt; current_user.posts.build(params[:post]) in this situation? Because i&lt;br&gt;&amp;gt; dont have the current_user helper anymore, because we are not dealing&lt;br&gt;&amp;gt; with users, but with the post that i want to create anotherposts ontop&lt;br&gt;&amp;gt; of.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; so basically instead of the current_user helper, i want to use the&lt;br&gt;&amp;gt; post that the anotherposts is being created on.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Do you understand? Hit me with more questions if you want :)&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; I really need help, this shouldn&amp;#39;t be difficult at all. Just a minor&lt;br&gt;&amp;gt; switch, that i can&amp;#39;t get my mind around. Hope you can help! thanks!!&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; On Mar 27, 10:26&amp;#160;am, Lasse Bunk &amp;lt;&lt;a href=&quot;mailto:lasseb...@gmail.com&quot;&gt;lasseb...@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; HeyDavid,&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; It&amp;#39;s really pretty easy and straightforward.&lt;br&gt;&amp;gt; &amp;gt; In your PostsController:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; def create&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; &amp;#160; @post = current_user.posts.build(params[:post])&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; &amp;#160; if @post.save&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; &amp;#160; &amp;#160; # ...&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; &amp;#160; else&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; &amp;#160; &amp;#160; # ...&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; &amp;#160; end&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; end&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; Also in your PostsController, to list posts only from current_user:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; def index&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; &amp;#160; @posts = current_user.posts&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; end&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; If you want your show method to only look for posts from current_user:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; def show&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; &amp;#160; @post = current_user.posts.find(params[:id])&lt;br&gt;&amp;gt; &amp;gt; &amp;#160; end&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; /Lasse&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; 2010/3/27DavidZhu&amp;lt;&lt;a href=&quot;mailto:dzwestwindso...@gmail.com&quot;&gt;dzwestwindso...@gmail.com&lt;/a&gt;&amp;gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; Hey,&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; I made my authentication system using Authlogic, and I have a&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; current_user helper&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; Now, I also made a scaffold called posts, and everytime a user creates&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; a post using that scaffold, i want it to be assigned to that&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; particular user.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; So i can render out the posts that ONLY that user made.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; Now, the question is what to do in the forms, and what to do in the&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; posts controller.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; Right now, I already have a has_many belongs_to relationship between&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; the too, but i dont know where to go next. What do i have to chnage in&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; the posts controller? What is my post form supposed to look like in&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; order for it to be associated with the current_user?&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; AWww ive been trying to get my mind around this, but i can&amp;#39;t. i need&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; help. really bad.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; Someone please help. please!!&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; --&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; You received this message because you are subscribed to the Google Groups&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; To unsubscribe from this group, send email to&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;&amp;lt;&lt;a href=&quot;mailto:rubyonrails-talk%252Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk%2Bunsubscribe@googlegroups.com&lt;/a&gt;&amp;gt;&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; .&lt;br&gt;&amp;gt; &amp;gt; &amp;gt; For more options, visit this group at&lt;br&gt;&amp;gt; &amp;gt; &amp;gt;&lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/rails-re-hasmany-belongsto-noobie.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-4206408134561082341</guid><pubDate>Fri, 02 Apr 2010 22:51:00 +0000</pubDate><atom:updated>2010-04-02T15:51:48.018-07:00</atom:updated><title>[Rails] Re: Rails model design visualization</title><description>On Apr 2, 3:49&amp;#160;pm, &amp;quot;Joe Smith&amp;quot; &amp;lt;&lt;a href=&quot;mailto:unknown_kev_...@hotmail.com&quot;&gt;unknown_kev_...@hotmail.com&lt;/a&gt;&amp;gt; wrote:&lt;p&gt;&amp;gt; In addition to railroads, The rubymine IDE has a visualization system. Uses&lt;br&gt;&amp;gt; the (proreitary) yFiles Graph visualization library, so the images look a&lt;br&gt;&amp;gt; little fancier, but the basic graphs are not too disimilar.&lt;p&gt;Thanks, Joe!  I&amp;#39;ll have to check it out...  Looks like us poor&lt;br&gt;academics are given a break on the price :)&lt;br&gt;Craig&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/rails-re-rails-model-design_1684.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-4403123394417978519</guid><pubDate>Fri, 02 Apr 2010 22:28:00 +0000</pubDate><atom:updated>2010-04-02T15:29:19.590-07:00</atom:updated><title>[Rails] Re: Weird date/time incompatibility</title><description>On Apr 2, 3:12&amp;#160;pm, Colin Law &amp;lt;&lt;a href=&quot;mailto:clan...@googlemail.com&quot;&gt;clan...@googlemail.com&lt;/a&gt;&amp;gt; wrote:&lt;p&gt;&amp;gt; Am I right in assuming that is what is contained in the &amp;lt;a href link&lt;br&gt;&amp;gt; in the html? &amp;#160;If so then the first thing is that they are in different&lt;br&gt;&amp;gt; timezones. &amp;#160;Can you confirm that you are definitely seeing the above&lt;br&gt;&amp;gt; dates with the same version of the code. &amp;#160;You said you had been&lt;p&gt;...&lt;br&gt;&amp;gt; Do you want to see a local time there or UTC?&lt;p&gt;Thanks again--the difference was that I had this in the development&lt;br&gt;config/enviroment.rb&lt;br&gt;config.time_zone = &amp;#39;UTC&amp;#39;&lt;br&gt;But not in the production file.  I uncommented it in the production&lt;br&gt;environment.rb just now, and lo and behold, that part is now working.&lt;p&gt;Except--I now remember I had in commented out of the production server&lt;br&gt;as another part of the code which displays the &amp;quot;created at&amp;quot; field for&lt;br&gt;a record was giving the wrong time.  E.g. if I run date in a terminal&lt;p&gt;I get Fri Apr  2 17:13:05 CDT 2010&lt;p&gt;(Which is my time)&lt;br&gt;But for the created at for this record in the database I&amp;#39;m getting&lt;p&gt;2010-04-02 22:13:33&lt;p&gt;I don&amp;#39;t seem to have that problem on my development machine (MacOS&lt;br&gt;laptop).  The production server is a Redhat Linux machine.&lt;p&gt;Any idea how to &amp;quot;sync&amp;quot; created at and the system time on the&lt;br&gt;production server?&lt;p&gt;Again, many TIA,&lt;br&gt;Craig&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/rails-re-weird-datetime-incompatibility_02.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-3404978053803618734</guid><pubDate>Fri, 02 Apr 2010 22:26:00 +0000</pubDate><atom:updated>2010-04-02T15:27:20.125-07:00</atom:updated><title>[Rails] HELP!! Rake aborted! Can&#39;t modify frozen hash</title><description>Too bad even the trace doesn&amp;#39;t say which hash is involved.&lt;p&gt;Sorry this post is long: am trying to provide enough context to be&lt;br&gt;meaningful.&lt;p&gt;Occurs _intermittently_ when rake jobs:work is pulling a command out of&lt;br&gt;delayed_jobs while my status observer is in the process of parsing a log&lt;br&gt;file for detailed results of the previous delayed_job denizen.  I have&lt;br&gt;an observer class (in RAILS_ROOT/lib ) which listens for the events,&lt;br&gt;makes a copy of them and calls the owner class ( in apps/models ) which&lt;br&gt;then calls on the log parser (also in /lib) to do the actual work.&lt;br&gt;(Should both of those classes, the observer and the parser be in&lt;br&gt;app/models?)&lt;p&gt;Am due to deliver this application in a few days and this is killing it&lt;br&gt;(and me).&lt;p&gt;Am using DirectoryWatcher to look for flag files that indicate the start&lt;br&gt;and finish of the delayed_jobs.&lt;br&gt;That is started at the end of environment.rb like this:&lt;p&gt;require &amp;#39;directory_watcher&amp;#39;&lt;br&gt;$scriptStatusObserver = ScriptStatusObserver.new&lt;br&gt;dirToWatch =&amp;quot;#{RAILS_ROOT}/tmp/flags&amp;quot;&lt;br&gt;$directoryWatcher = DirectoryWatcher.new( dirToWatch )&lt;br&gt;$directoryWatcher.glob= &amp;quot;*.flg&amp;quot;&lt;br&gt;$directoryWatcher.interval=(15)&lt;br&gt;$directoryWatcher.add_observer( $scriptStatusObserver )&lt;br&gt;$directoryWatcher.persist=(&amp;quot;#{RAILS_ROOT}/tmp/flags/dw_state.yml&amp;quot;)&lt;br&gt;$directoryWatcher.start&lt;p&gt;at_exit { $directoryWatcher.stop }&lt;p&gt;This code is outside of the run method (btw is that the best place or is&lt;br&gt;inside the run better?)&lt;p&gt;Here is the observer:&lt;br&gt;require &amp;#39;script_run&amp;#39;&lt;p&gt;class ScriptStatusObserver&lt;p&gt;  def initialize&lt;br&gt;    @rcvdEvents = []&lt;br&gt;  end&lt;p&gt;  def update( *events )&lt;br&gt;    begin&lt;br&gt;      puts &amp;quot;#{__LINE__.to_s}: ScriptStatusObserver events:&lt;br&gt;\n&amp;quot;+events.to_yaml&lt;br&gt;      cnt = 0&lt;p&gt;      events.each do |e|&lt;br&gt;        if e.to_s.match(/^\s*added/)&lt;br&gt;          cnt = cnt + 1&lt;br&gt;        @rcvdEvents &amp;lt;&amp;lt; e&lt;br&gt;        end&lt;br&gt;      end&lt;p&gt;      ScriptRun.new.catch_up( @rcvdEvents ) if cnt &amp;gt; 0&lt;p&gt;      @rcvdEvents.clear&lt;p&gt;    rescue&lt;br&gt;      puts $!&lt;br&gt;    end&lt;p&gt;  end&lt;br&gt;end&lt;p&gt;Here is ScriptRun (it attaches to an associative table built with&lt;br&gt;has_many:through)&lt;p&gt;#require &amp;#39;observer&amp;#39;&lt;p&gt;class ScriptRun &amp;lt; ActiveRecord::Base&lt;p&gt;  set_table_name &amp;quot;scripts_runs&amp;quot;&lt;br&gt;  belongs_to :script&lt;br&gt;  belongs_to :run&lt;p&gt;  def parse( result )&lt;br&gt;    parser = LogParser.new&lt;br&gt;    parser.parse(result)&lt;br&gt;  end&lt;p&gt;  def catch_up( events )&lt;br&gt;     events.each do |e|&lt;br&gt;      typ       = e.type&lt;br&gt;      path      = e.path&lt;p&gt;      thisMatch = path.match(/flags\/(\d+)_(\d+)_([\d\.]+)_(\w+)\.flg/)&lt;br&gt;      run_id    = thisMatch[1]&lt;br&gt;      script_id = thisMatch[2]&lt;br&gt;      ts        = thisMatch[3]&lt;br&gt;      status    = thisMatch[4]&lt;p&gt;      if e.to_s.match(/^\s*added/)&lt;br&gt;        status_update( script_id, run_id, status, ts, path )&lt;br&gt;      end&lt;br&gt;    end&lt;br&gt;  end&lt;p&gt;  def status_update( script_id, run_id, status, ts, path )&lt;p&gt;    scriptrun = ScriptRun.find(:first, :conditions =&amp;gt; [ &amp;quot;run_id = ? and&lt;br&gt;script_id = ?&amp;quot;, run_id.to_i, script_id.to_i ])&lt;p&gt;    if scriptrun.kind_of?(ScriptRun)&lt;br&gt;      currStatus = scriptrun.status&lt;br&gt;      if not currStatus == &amp;#39;completed&amp;#39;&lt;p&gt;        scriptrun.update_attribute(:status, status)&lt;p&gt;        if status == &amp;#39;parse&amp;#39;&lt;br&gt;          flag    = File.new(path)&lt;br&gt;          logSpec = flag.gets&lt;br&gt;          flag.close&lt;p&gt;          logName  = File.basename(logSpec)&lt;br&gt;          logPath  = logSpec.sub(logName, &amp;#39;&amp;#39;)&lt;p&gt;          logName =~ /^(([\w_]+)_([\w]+)_(\d+))\.log$/&lt;br&gt;          name     = $1&lt;br&gt;          basename = $2&lt;br&gt;          runenv   = $3&lt;br&gt;          tsOrPid  = $4&lt;p&gt;          result           = Result.new&lt;br&gt;          result.log_path  = logPath&lt;br&gt;          result.basename  = basename&lt;br&gt;          &lt;a href=&quot;http://result.name&quot;&gt;result.name&lt;/a&gt;      = name&lt;br&gt;          result.script_id = script_id.to_i&lt;br&gt;          result.run_id    = run_id.to_i&lt;br&gt;          if runenv == &amp;#39;sit&amp;#39;&lt;br&gt;              runenv = &amp;#39;SIT3348&amp;#39;&lt;br&gt;          end&lt;br&gt;          result.application_environment_id =&lt;br&gt;                ApplicationEnvironment.find(:first, :conditions =&amp;gt; [&lt;br&gt;&amp;quot;nodename = ?&amp;quot;, runenv]).id&lt;p&gt;          parse(result)&lt;p&gt;          if run_completed?( run_id )&lt;br&gt;            myRun = Run.find(run_id.to_i)&lt;br&gt;            if myRun.kind_of?( Run )&lt;br&gt;              myRun.update_attribute( :completed, Time.now.to_f )&lt;br&gt;            end&lt;br&gt;          end&lt;p&gt;        end&lt;br&gt;      end&lt;p&gt;    else&lt;br&gt;      puts &amp;quot;#{__LINE__.to_s}: ScriptRun.status_update: ScriptRun not&lt;br&gt;found for run #{run_id} script #{script_id} ts #{ts.to_s}&amp;quot;&lt;br&gt;    end&lt;p&gt;  File.delete(path)&lt;p&gt;  end&lt;p&gt;  def run_completed?( id )&lt;br&gt;    scriptruns = ScriptRun.find(:all, :conditions =&amp;gt; [ &amp;quot;run_id = ?&amp;quot;,&lt;br&gt;id.to_i] )&lt;br&gt;    scriptruns.each do |sr|&lt;br&gt;      if not sr.status == &amp;#39;completed&amp;#39;&lt;br&gt;        return false&lt;br&gt;      end&lt;br&gt;    end&lt;br&gt;    return true&lt;br&gt;  end&lt;br&gt;end&lt;p&gt;LogParser is too long even for this post but it reads the script log and&lt;br&gt;pulls detailed information (counts and timings) out of the log and&lt;br&gt;writes to a details table. It also tallies and calculates averages and&lt;br&gt;rolls those up into summary tables for quicker access from the web&lt;br&gt;pages.&lt;p&gt;Here is the error trace:&lt;br&gt;(don&amp;#39;t ask why everything is under my Windows profile.  It&amp;#39;s a long&lt;br&gt;story)&lt;p&gt;Scanner running 1270239731.43&lt;br&gt;directory_watcher.notify_observers: #&amp;lt;ScriptStatusObserver:0x48ae838&lt;br&gt;@rcvdEvents&lt;br&gt;=[#&amp;lt;struct DirectoryWatcher::Event type=:added, path=&amp;quot;C:/Documents and&lt;br&gt;Settings/&lt;br&gt;pneve/workspace/waftt-0.29/tmp/flags/100039_11_1270236464.921_parse.flg&amp;quot;&amp;gt;,&lt;br&gt;#&amp;lt;str&lt;br&gt;uct DirectoryWatcher::Event type=:added, path=&amp;quot;C:/Documents and&lt;br&gt;Settings/pneve/w&lt;br&gt;orkspace/waftt-0.29/tmp/flags/100039_18_1270239550.108_parse.flg&amp;quot;&amp;gt;]&amp;gt;&lt;br&gt;update:[#&amp;lt;struct DirectoryWatcher::Event type=:added, path=&amp;quot;C:/Documents&lt;br&gt;and Set&lt;br&gt;tings/pneve/workspace/waftt-0.29/tmp/flags/100039_19_1270239727.368_parse.flg&amp;quot;&amp;gt;,&lt;br&gt;#&amp;lt;struct DirectoryWatcher::Event type=:removed, path=&amp;quot;C:/Documents and&lt;br&gt;Settings&lt;br&gt;/pneve/workspace/waftt-0.29/tmp/flags/100039_18_1270239550.108_parse.flg&amp;quot;&amp;gt;]&lt;br&gt;rake aborted!&lt;br&gt;can&amp;#39;t modify frozen hash&lt;br&gt;C:/Documents and&lt;br&gt;Settings/pneve/workspace/waftt-0.29/vendor/rails/activerecord/l&lt;br&gt;ib/active_record/attribute_methods.rb:313:in `[]=&amp;#39;&lt;br&gt;C:/Documents and&lt;br&gt;Settings/pneve/workspace/waftt-0.29/vendor/rails/activerecord/l&lt;br&gt;ib/active_record/attribute_methods.rb:313:in&lt;br&gt;`write_attribute_without_dirty&amp;#39;&lt;br&gt;C:/Documents and&lt;br&gt;Settings/pneve/workspace/waftt-0.29/vendor/rails/activerecord/l&lt;br&gt;ib/active_record/dirty.rb:139:in `write_attribute&amp;#39;&lt;br&gt;C:/Documents and&lt;br&gt;Settings/pneve/workspace/waftt-0.29/vendor/rails/activerecord/l&lt;br&gt;ib/active_record/attribute_methods.rb:211:in `last_error=&amp;#39;&lt;br&gt;C:/Documents and&lt;br&gt;Settings/pneve/workspace/waftt-0.29/vendor/plugins/delayed_job/&lt;br&gt;lib/delayed/worker.rb:141:in `handle_failed_job&amp;#39;&lt;br&gt;C:/Documents and&lt;br&gt;Settings/pneve/workspace/waftt-0.29/vendor/plugins/delayed_job/&lt;br&gt;lib/delayed/worker.rb:115:in `run&amp;#39;&lt;br&gt;C:/Documents and&lt;br&gt;Settings/pneve/workspace/waftt-0.29/vendor/plugins/delayed_job/&lt;br&gt;lib/delayed/worker.rb:162:in `reserve_and_run_one_job&amp;#39;&lt;br&gt;C:/Documents and&lt;br&gt;Settings/pneve/workspace/waftt-0.29/vendor/plugins/delayed_job/&lt;br&gt;lib/delayed/worker.rb:92:in `work_off&amp;#39;&lt;br&gt;C:/Documents and&lt;br&gt;Settings/pneve/workspace/waftt-0.29/vendor/plugins/delayed_job/&lt;br&gt;lib/delayed/worker.rb:91:in `times&amp;#39;&lt;br&gt;C:/Documents and&lt;br&gt;Settings/pneve/workspace/waftt-0.29/vendor/plugins/delayed_job/&lt;br&gt;lib/delayed/worker.rb:91:in `work_off&amp;#39;&lt;br&gt;C:/Documents and&lt;br&gt;Settings/pneve/workspace/waftt-0.29/vendor/plugins/delayed_job/&lt;br&gt;lib/delayed/worker.rb:66:in `start&amp;#39;&lt;br&gt;C:/Documents and&lt;br&gt;Settings/pneve/workspace/waftt-0.29/vendor/rails/activesupport/&lt;br&gt;lib/active_support/core_ext/benchmark.rb:10:in `realtime&amp;#39;&lt;br&gt;C:/Documents and&lt;br&gt;Settings/pneve/workspace/waftt-0.29/vendor/plugins/delayed_job/&lt;br&gt;lib/delayed/worker.rb:65:in `start&amp;#39;&lt;br&gt;C:/Documents and&lt;br&gt;Settings/pneve/workspace/waftt-0.29/vendor/plugins/delayed_job/&lt;br&gt;lib/delayed/worker.rb:62:in `loop&amp;#39;&lt;br&gt;C:/Documents and&lt;br&gt;Settings/pneve/workspace/waftt-0.29/vendor/plugins/delayed_job/&lt;br&gt;lib/delayed/worker.rb:62:in `start&amp;#39;&lt;br&gt;C:/Documents and&lt;br&gt;Settings/pneve/workspace/waftt-0.29/vendor/plugins/delayed_job/&lt;br&gt;lib/delayed/tasks.rb:13&lt;br&gt;c:/Documents and&lt;br&gt;Settings/pneve/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.&lt;br&gt;rb:636:in `call&amp;#39;&lt;br&gt;c:/Documents and&lt;br&gt;Settings/pneve/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.&lt;br&gt;rb:636:in `execute&amp;#39;&lt;br&gt;c:/Documents and&lt;br&gt;Settings/pneve/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.&lt;br&gt;rb:631:in `each&amp;#39;&lt;br&gt;c:/Documents and&lt;br&gt;Settings/pneve/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.&lt;br&gt;rb:631:in `execute&amp;#39;&lt;br&gt;c:/Documents and&lt;br&gt;Settings/pneve/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.&lt;br&gt;rb:597:in `invoke_with_call_chain&amp;#39;&lt;br&gt;c:/Documents and Settings/pneve/ruby/lib/ruby/1.8/monitor.rb:242:in&lt;br&gt;`synchronize&lt;br&gt;&amp;#39;&lt;br&gt;c:/Documents and&lt;br&gt;Settings/pneve/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.&lt;br&gt;rb:590:in `invoke_with_call_chain&amp;#39;&lt;br&gt;c:/Documents and&lt;br&gt;Settings/pneve/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.&lt;br&gt;rb:583:in `invoke&amp;#39;&lt;br&gt;c:/Documents and&lt;br&gt;Settings/pneve/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.&lt;br&gt;rb:2051:in `invoke_task&amp;#39;&lt;br&gt;c:/Documents and&lt;br&gt;Settings/pneve/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.&lt;br&gt;rb:2029:in `top_level&amp;#39;&lt;br&gt;c:/Documents and&lt;br&gt;Settings/pneve/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.&lt;br&gt;rb:2029:in `each&amp;#39;&lt;br&gt;c:/Documents and&lt;br&gt;Settings/pneve/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.&lt;br&gt;rb:2029:in `top_level&amp;#39;&lt;br&gt;c:/Documents and&lt;br&gt;Settings/pneve/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.&lt;br&gt;rb:2068:in `standard_exception_handling&amp;#39;&lt;br&gt;c:/Documents and&lt;br&gt;Settings/pneve/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.&lt;br&gt;rb:2023:in `top_level&amp;#39;&lt;br&gt;c:/Documents and&lt;br&gt;Settings/pneve/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.&lt;br&gt;rb:2001:in `run&amp;#39;&lt;br&gt;c:/Documents and&lt;br&gt;Settings/pneve/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.&lt;br&gt;rb:2068:in `standard_exception_handling&amp;#39;&lt;br&gt;c:/Documents and&lt;br&gt;Settings/pneve/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.&lt;br&gt;rb:1998:in `run&amp;#39;&lt;br&gt;c:/Documents and&lt;br&gt;Settings/pneve/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:&lt;br&gt;31&lt;br&gt;c:/Documents and Settings/pneve/ruby/bin/rake:16:in `load&amp;#39;&lt;br&gt;c:/Documents and Settings/pneve/ruby/bin/rake:16&lt;br&gt;-- &lt;br&gt;Posted via &lt;a href=&quot;http://www.ruby-forum.com/&quot;&gt;http://www.ruby-forum.com/&lt;/a&gt;.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/rails-help-rake-aborted-cant-modify.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-9208045624379335529</guid><pubDate>Fri, 02 Apr 2010 22:01:00 +0000</pubDate><atom:updated>2010-04-02T15:01:49.942-07:00</atom:updated><title>[Rails] Re: Trying to create search filter persistence using  SearchLogic</title><description>Patrick Shainin wrote:&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; For example, to add a check box that limits the search to rows with a &lt;br&gt;&amp;gt; certain condition, you could define a named scope in Model.rb like this:&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; named_scope :my_condition, :conditions =&amp;gt; &amp;quot;your sql condition here&amp;quot;&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; Then in the view form, you would include:&lt;br&gt;&amp;gt; &amp;amp;lt;%= f.label :my_condition, &amp;quot;Check to apply my condition&amp;quot; %&amp;amp;gt;&lt;br&gt;&amp;gt; &amp;amp;lt;%= f.check_box :my_condition %&amp;amp;gt;&lt;p&gt;I forgot that f.check_box adds a hidden field so even unchecked, the &lt;br&gt;condition will trigger.  One way to get around that is to use lambda in &lt;br&gt;the named scope and adjust what condition gets included based on the &lt;br&gt;check box value:&lt;p&gt;named_scope :my_condition, lambda { |check| &amp;quot;1&amp;quot;==check ? {:conditions=&amp;gt; &lt;br&gt;&amp;quot;your sql condition here&amp;quot;} : {}}&lt;br&gt;-- &lt;br&gt;Posted via &lt;a href=&quot;http://www.ruby-forum.com/&quot;&gt;http://www.ruby-forum.com/&lt;/a&gt;.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/rails-re-trying-to-create-search-filter_02.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-6592208796785360333</guid><pubDate>Fri, 02 Apr 2010 21:27:00 +0000</pubDate><atom:updated>2010-04-02T14:53:03.118-07:00</atom:updated><title>[Rails] &quot;new&quot; form as partial?</title><description>Hi!&lt;p&gt;I think I&amp;#39;m trying to accomplish something very common, but I can&amp;#39;t&lt;br&gt;find a way to do it.&lt;p&gt;Creating a certain type of database record is a very frequent task in&lt;br&gt;my application (or at least it should be ;-)). So I want to be able to&lt;br&gt;place the form for creating that database record in practically any&lt;br&gt;view, not just the /mymodel/new view.&lt;p&gt;I figured that this might be done using a partial, but since I&amp;#39;m&lt;br&gt;pretty new to rails, I don&amp;#39;t get it one.&lt;p&gt;Can anybody point me to a tutorial for this problem?&lt;p&gt;I&amp;#39;m using rails 2.3.5.&lt;p&gt;Thank you!&lt;br&gt;Marian&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/rails-new-form-as-partial.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-3112326213093039360</guid><pubDate>Fri, 02 Apr 2010 21:24:00 +0000</pubDate><atom:updated>2010-04-02T14:25:23.990-07:00</atom:updated><title>[spree-user] Re: User Personalisation of Products</title><description>The admin side of my extension is now working: an admin can set a&lt;br&gt;product to be personalisable, and can then set personalisation options&lt;br&gt;against a product.&lt;p&gt;Now I would like to display these results of these options to&lt;br&gt;customers:&lt;p&gt;The product has a personalisable? attribute. The product may also have&lt;br&gt;many personalisation_options associated with it. Each&lt;br&gt;personalisation_option has name, title and max_length&lt;p&gt;Step 1 now has me a little flummoxed: I need to build fields on the&lt;br&gt;product page for each personalisation_option associated with a&lt;br&gt;product, rendered as a label with title as its contents, and a text&lt;br&gt;field that limits to the number of character specified in max_length.&lt;p&gt;How do I go about this in spree / rails?&lt;p&gt;For anyone interested in helping, the current extension can be found&lt;br&gt;in its current gestation at git://&lt;a href=&quot;http://github.com/peachygifts/spree-personalisation.git&quot;&gt;github.com/peachygifts/spree-personalisation.git&lt;/a&gt;&lt;p&gt;Thanks for your help!&lt;p&gt;Michael&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Spree&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:spree-user@googlegroups.com&quot;&gt;spree-user@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:spree-user%2Bunsubscribe@googlegroups.com&quot;&gt;spree-user+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/spree-user?hl=en&quot;&gt;http://groups.google.com/group/spree-user?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/spree-user-re-user-personalisation-of.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-5238616667477669370</guid><pubDate>Fri, 02 Apr 2010 21:12:00 +0000</pubDate><atom:updated>2010-04-02T14:13:31.855-07:00</atom:updated><title>Re: [Rails] Re: Rails model design visualization</title><description>&amp;gt;&amp;gt; Railroad does this (after a fashion) &lt;a href=&quot;http://railroad.rubyforge.org/&quot;&gt;http://railroad.rubyforge.org/&lt;/a&gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; So that rocks.  When did the world get so ultra cool?  *Many, many*&lt;br&gt;&amp;gt; thanks.&lt;p&gt;plus one from me! Thank you very much!&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/re-rails-re-rails-model-design_02.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-8875062408835214735</guid><pubDate>Fri, 02 Apr 2010 21:12:00 +0000</pubDate><atom:updated>2010-04-02T14:13:23.076-07:00</atom:updated><title>Re: [Rails] Re: Rails model design visualization</title><description>&amp;gt;&amp;gt; Railroad does this (after a fashion) &lt;a href=&quot;http://railroad.rubyforge.org/&quot;&gt;http://railroad.rubyforge.org/&lt;/a&gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; So that rocks. &amp;#160;When did the world get so ultra cool? &amp;#160;*Many, many*&lt;br&gt;&amp;gt; thanks.&lt;p&gt;plus one from me! Thank you very much!&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/re-rails-re-rails-model-design.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-8728273357930778279</guid><pubDate>Fri, 02 Apr 2010 21:10:00 +0000</pubDate><atom:updated>2010-04-02T14:11:10.038-07:00</atom:updated><title>[Rails] Re: Two controllers with create using the same model</title><description>Thanks a lot Colin,&lt;p&gt;First of all, I&amp;#39;m using Rails 2.3.5. and Ruby 1.8.7.&lt;br&gt;The generated HTML looks like this: &amp;lt;form method=&amp;quot;post&amp;quot;&lt;br&gt;id=&amp;quot;beiratkozok&amp;quot; action=&amp;quot;/beiratkozas&amp;quot;&amp;gt;&lt;br&gt;The option suggested by you: &amp;lt;% form_for :student, @student, :url =&amp;gt;&lt;br&gt;{:controller =&amp;gt; &amp;#39;beiratkozas&amp;#39;, :action =&amp;gt; &amp;quot;create&amp;quot; }, :html =&amp;gt;&lt;br&gt;{ :method =&amp;gt; :post, :id =&amp;gt; &amp;quot;beiratkozok&amp;quot; }   do |f| %&amp;gt; gives the very&lt;br&gt;same result, so somehow the form_for assumes that controller is&lt;br&gt;&amp;#39;beiratkozas&amp;#39;. Maybe because the path is: Views/beiratkozas/&lt;br&gt;new.html.erb to the view that contains the form_for.&lt;p&gt;And works, since I have:&lt;p&gt;  map.connect &amp;#39;beiratkozok&amp;#39;, :controller =&amp;gt; &amp;#39;beiratkozas&amp;#39;, :action =&amp;gt;&lt;br&gt;&amp;#39;new&amp;#39;&lt;br&gt;  map.connect &amp;#39;hallgato/:id&amp;#39;, :controller =&amp;gt; &amp;#39;beiratkozas&amp;#39;, :action =&amp;gt;&lt;br&gt;&amp;#39;show&amp;#39;&lt;br&gt;  map.connect &amp;#39;beiratkozas&amp;#39;, :controller =&amp;gt; &amp;#39;beiratkozas&amp;#39;, :action =&amp;gt;&lt;br&gt;&amp;#39;create&amp;#39;&lt;p&gt;I know that map.resources :beiratkozas would be a more Rails like&lt;br&gt;approach, but it&amp;#39;s more human readable for Hungarians if I use&lt;br&gt;meaningful Hungarian words.&lt;p&gt;The html is added since I need the ID for CSS, and I wanted a&lt;br&gt;meaningful word as ID, since it makes CSS easier to read. On the other&lt;br&gt;hand :method =&amp;gt; :post was added since I saw something like that&lt;br&gt;somewhere, and it made sense, since I want to use the POST verb in&lt;br&gt;this case. Right?&lt;p&gt;Peter&lt;p&gt;P.S.: What do you mean putting my comments inline with the previous&lt;br&gt;post? I&amp;#39;m simply hitting reply.&lt;p&gt;&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/rails-re-two-controllers-with-create_3322.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-7261736771580808016</guid><pubDate>Fri, 02 Apr 2010 21:09:00 +0000</pubDate><atom:updated>2010-04-02T14:10:20.744-07:00</atom:updated><title>Re: [Radiant-Dev] [ANN] PageFactory extension</title><description>&amp;gt;&amp;gt;&amp;gt; On a side note, another thing I realized is that there should be  &lt;br&gt;&amp;gt;&amp;gt;&amp;gt; some&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; description for the available templates.&lt;br&gt;&amp;gt;&amp;gt;&lt;br&gt;&amp;gt;&amp;gt; This would be nice. Do we have an existing UI pattern for a modal  &lt;br&gt;&amp;gt;&amp;gt; containing&lt;br&gt;&amp;gt;&amp;gt; a table instead of a select element?&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; I don&amp;#39;t believe we do.&lt;p&gt;OK. I&amp;#39;ll put something basic together and someone who knows pixels can  &lt;br&gt;sort it out.&lt;p&gt;On Apr 2, 2010, at 3:41 PM, Jim Gay wrote:&lt;p&gt;&amp;gt; On Fri, Apr 2, 2010 at 3:01 PM, Josh French &amp;lt;&lt;a href=&quot;mailto:josh@digitalpulp.com&quot;&gt;josh@digitalpulp.com&lt;/a&gt;&amp;gt;  &lt;br&gt;&amp;gt; wrote:&lt;br&gt;&amp;gt;&amp;gt; If the above method is available to the controller/view, then it  &lt;br&gt;&amp;gt;&amp;gt; already has&lt;br&gt;&amp;gt;&amp;gt; access to the @page instance and current user, plus anything else I  &lt;br&gt;&amp;gt;&amp;gt; can find&lt;br&gt;&amp;gt;&amp;gt; in the current request.&lt;br&gt;&amp;gt;&amp;gt;&lt;br&gt;&amp;gt;&amp;gt; On the other hand, Page#factories(current_user=nil) implies there&amp;#39;s  &lt;br&gt;&amp;gt;&amp;gt; only one&lt;br&gt;&amp;gt;&amp;gt; dimension you can filter on. It makes it harder for extensions  &lt;br&gt;&amp;gt;&amp;gt; which might&lt;br&gt;&amp;gt;&amp;gt; want to filter by something we haven&amp;#39;t thought of yet.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Good point.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt;&amp;gt;&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; On a side note, another thing I realized is that there should be  &lt;br&gt;&amp;gt;&amp;gt;&amp;gt; some&lt;br&gt;&amp;gt;&amp;gt;&amp;gt; description for the available templates.&lt;br&gt;&amp;gt;&amp;gt;&lt;br&gt;&amp;gt;&amp;gt; This would be nice. Do we have an existing UI pattern for a modal  &lt;br&gt;&amp;gt;&amp;gt; containing&lt;br&gt;&amp;gt;&amp;gt; a table instead of a select element?&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; I don&amp;#39;t believe we do.&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; -- &lt;br&gt;&amp;gt; Jim Gay&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.saturnflyer.com&quot;&gt;http://www.saturnflyer.com&lt;/a&gt;&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; -- &lt;br&gt;&amp;gt; Radiant CMS Dev Mailing List&lt;br&gt;&amp;gt; Post:        &lt;a href=&quot;mailto:radiantcms-dev@googlegroups.com&quot;&gt;radiantcms-dev@googlegroups.com&lt;/a&gt;&lt;br&gt;&amp;gt; Unsubscribe: &lt;a href=&quot;mailto:radiantcms-dev-unsubscribe@googlegroups.com&quot;&gt;radiantcms-dev-unsubscribe@googlegroups.com&lt;/a&gt;&lt;br&gt;&amp;gt; Group Site:  &lt;a href=&quot;http://groups.google.com/group/radiantcms-dev/&quot;&gt;http://groups.google.com/group/radiantcms-dev/&lt;/a&gt;&lt;p&gt;-- &lt;br&gt;Radiant CMS Dev Mailing List&lt;br&gt;Post:        &lt;a href=&quot;mailto:radiantcms-dev@googlegroups.com&quot;&gt;radiantcms-dev@googlegroups.com&lt;/a&gt;&lt;br&gt;Unsubscribe: &lt;a href=&quot;mailto:radiantcms-dev-unsubscribe@googlegroups.com&quot;&gt;radiantcms-dev-unsubscribe@googlegroups.com&lt;/a&gt;&lt;br&gt;Group Site:  &lt;a href=&quot;http://groups.google.com/group/radiantcms-dev/&quot;&gt;http://groups.google.com/group/radiantcms-dev/&lt;/a&gt;&lt;p&gt;To unsubscribe, reply using &amp;quot;remove me&amp;quot; as the subject.</description><link>http://rubyonrailsin.blogspot.com/2010/04/re-radiant-dev-ann-pagefactory_2584.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-811088145650234124</guid><pubDate>Fri, 02 Apr 2010 21:05:00 +0000</pubDate><atom:updated>2010-04-02T14:13:33.233-07:00</atom:updated><title>[Rails] Re: Trying to create search filter persistence using  SearchLogic</title><description>dburges wrote:&lt;br&gt;&amp;gt; I have just set up a search form on my index using SearchLogic- it&lt;br&gt;&amp;gt; works great. However, since there are several search parameters in the&lt;br&gt;&amp;gt; form I want the results of the most recent search to remain in effect&lt;br&gt;&amp;gt; until the user does a new search. I can&amp;#39;t figure out how to do this!&lt;br&gt;&amp;gt; I&amp;#39;ve tried a few things with global and session variables but just&lt;br&gt;&amp;gt; can&amp;#39;t get it working.&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; Any advice would be greatly appreciated!&lt;p&gt;The previous form values you want for re-initializing the form are &lt;br&gt;passed into your controller method in the params object. If you have &lt;br&gt;built your form around an object called @search like this:&lt;p&gt;form_for @search do |f|&lt;p&gt;you just need to initialize @search with the search values in params, in &lt;br&gt;the controller method (perhaps Controller#index), like this:&lt;p&gt;@search = Model.search(params[:search])&lt;p&gt;If you have fields that are not part of Model that you want to include &lt;br&gt;in the search and have those initialized to, define a named_scope in &lt;br&gt;Model, and use that named_scope in the form for @search. Then it will &lt;br&gt;also be part of the params search values and get initialized along with &lt;br&gt;the other, automatically generated named scopes that correspond to the &lt;br&gt;model fields.&lt;p&gt;For example, to add a check box that limits the search to rows with a &lt;br&gt;certain condition, you could define a named scope in Model.rb like this:&lt;p&gt;named_scope :my_condition, :conditions =&amp;gt; &amp;quot;your sql condition here&amp;quot;&lt;p&gt;Then in the view form, you would include:&lt;br&gt;&amp;amp;lt;%= f.label :my_condition, &amp;quot;Check to apply my condition&amp;quot; %&amp;amp;gt;&lt;br&gt;&amp;amp;lt;%= f.check_box :my_condition %&amp;amp;gt;&lt;br&gt;-- &lt;br&gt;Posted via &lt;a href=&quot;http://www.ruby-forum.com/&quot;&gt;http://www.ruby-forum.com/&lt;/a&gt;.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/rails-re-trying-to-create-search-filter.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-1507274828812671052.post-8564645554560934427</guid><pubDate>Fri, 02 Apr 2010 20:58:00 +0000</pubDate><atom:updated>2010-04-02T14:06:09.535-07:00</atom:updated><title>Re: [Rails] http://api.rubyonrails.org/ not working!!</title><description>On Fri, Apr 2, 2010 at 8:57 PM, rorguy &amp;lt;&lt;a href=&quot;mailto:amanbop@gmail.com&quot;&gt;amanbop@gmail.com&lt;/a&gt;&amp;gt; wrote:&lt;p&gt;&amp;gt; Not sure if anyone else has looked at it, but I have been seeing this&lt;br&gt;&amp;gt; for about a week now. The link &amp;quot;Rails: Complete API&amp;quot; on Documentaion&lt;br&gt;&amp;gt; page on &lt;a href=&quot;http://rubyonrails.org/documentation&quot;&gt;http://rubyonrails.org/documentation&lt;/a&gt; is not working. It fails&lt;br&gt;&amp;gt; with following error:&lt;br&gt;&amp;gt;&lt;br&gt;&amp;gt; Precondition Failed&lt;br&gt;&amp;gt; The precondition on the request for the URL /index.php evaluated to&lt;br&gt;&amp;gt; false.&lt;p&gt;This happens sometimes in my place. Looks like it may be some&lt;br&gt;country-level proxy in Spain or something according to some people.&lt;br&gt;The site is up.&lt;p&gt;-- &lt;br&gt;You received this message because you are subscribed to the Google Groups &amp;quot;Ruby on Rails: Talk&amp;quot; group.&lt;br&gt;To post to this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk@googlegroups.com&quot;&gt;rubyonrails-talk@googlegroups.com&lt;/a&gt;.&lt;br&gt;To unsubscribe from this group, send email to &lt;a href=&quot;mailto:rubyonrails-talk%2Bunsubscribe@googlegroups.com&quot;&gt;rubyonrails-talk+unsubscribe@googlegroups.com&lt;/a&gt;.&lt;br&gt;For more options, visit this group at &lt;a href=&quot;http://groups.google.com/group/rubyonrails-talk?hl=en&quot;&gt;http://groups.google.com/group/rubyonrails-talk?hl=en&lt;/a&gt;.</description><link>http://rubyonrailsin.blogspot.com/2010/04/re-rails-httpapirubyonrailsorg-not_02.html</link><author>noreply@blogger.com (Sandip Ransing)</author><thr:total>0</thr:total></item></channel></rss>