<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Rails Forum - Ruby on Rails Help and Discussion Forum]]></title>
		<link>http://railsforum.com/index.php</link>
		<description><![CDATA[The most recent topics at Rails Forum - Ruby on Rails Help and Discussion Forum.]]></description>
		<lastBuildDate>Tue, 09 Feb 2010 01:49:48 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[What MYSQL GUI is this?]]></title>
			<link>http://railsforum.com/viewtopic.php?id=16143&amp;action=new</link>
			<description><![CDATA[<p>Here is a screenshot<br /><a href="http://farm3.static.flickr.com/2099/2303421879_21428be917_o.png">http://farm3.static.flickr.com/2099/230 &#133; e917_o.png</a></p><p>Its the one they use in the <a href="http://rubyonrails.org/screencasts">Creating a weblog in 15 minutes</a> screencast</p>]]></description>
			<author><![CDATA[dummy@example.com (Vi.)]]></author>
			<pubDate>Tue, 09 Feb 2010 01:49:48 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?id=16143&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Pimp your editor]]></title>
			<link>http://railsforum.com/viewtopic.php?id=658&amp;action=new</link>
			<description><![CDATA[<p>This is the thread where you give info about your favorite editors. Include useful info like price, license terms, languages supported, etc. and give a brief description. I&#039;ll start:</p><p><a href="http://macromates.com">TextMate</a><br /><strong>OS:</strong> Mac (universal binary)<br /><strong>Price:</strong> 39 euros (about US$50)<br /><strong>License:</strong> closed source<br /><strong>Languages supported:</strong> everything I&#039;ve thrown at it (Ruby/Rails, Python, PHP, Java, XML, HTML, JS, CSS, etc.)<br /><strong>Description:</strong> TextMate is basically THE editor for Rails if you own a Mac. Plenty of help is available online for getting the most out of TextMate features like snippets, autocompletion, and more. It&#039;s also quite useful for other languages like PHP or Java in addition to being a great text editor for client-side duties like HTML or CSS.</p><p>Also feel free to add any comments about an editor that someone else has posted.</p>]]></description>
			<author><![CDATA[dummy@example.com (Vi.)]]></author>
			<pubDate>Tue, 09 Feb 2010 01:30:15 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?id=658&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[How important are RESTful routes in this situation?]]></title>
			<link>http://railsforum.com/viewtopic.php?id=37162&amp;action=new</link>
			<description><![CDATA[<p>I want to have short urls for one of my controllers. The urls look like <a href="http://whatever.com/MainControllerName/:id">http://whatever.com/MainControllerName/:id</a> but I&#039;d like the url to be shorter like: <a href="http://whatever.com/:id">http://whatever.com/:id</a> but this is not restful, correct? If I only have the one main controller plus a &quot;static&quot; controller for the other pages, is it okay that I have unRESTful urls for my MainController?</p>]]></description>
			<author><![CDATA[dummy@example.com (cherring)]]></author>
			<pubDate>Tue, 09 Feb 2010 00:54:31 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?id=37162&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Hover Table Popup]]></title>
			<link>http://railsforum.com/viewtopic.php?id=37158&amp;action=new</link>
			<description><![CDATA[<p>I am looking for something like when you mouse over &#039;Choose Category&#039; (upper right hand corner) @ <a href="http://www.ruby-toolbox.com/.">http://www.ruby-toolbox.com/.</a></p><p>Any suggestions on how this is done?</p>]]></description>
			<author><![CDATA[dummy@example.com (jmesserer)]]></author>
			<pubDate>Tue, 09 Feb 2010 00:24:48 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?id=37158&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Damn css, can someone throw me a bone]]></title>
			<link>http://railsforum.com/viewtopic.php?id=37129&amp;action=new</link>
			<description><![CDATA[<p>Okay I&#039;ve got a nice little table full of inputs with width set to 100% so they nicely fill each cell but i&#039;ve got a bit of an issue. The table is inserted into the html via ajax after this is done i convert the date fields in jquery-ui datepicker fields which adds a button after the input. Because the width is 100% the button gets pushed to the next line which is fugly. </p><p>What can i do so that the input and button fill 100% of their containing cell?</p>]]></description>
			<author><![CDATA[dummy@example.com (Vi.)]]></author>
			<pubDate>Tue, 09 Feb 2010 00:13:34 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?id=37129&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[ActiveRecord::AssociationTypeMismatch error in create action]]></title>
			<link>http://railsforum.com/viewtopic.php?id=37138&amp;action=new</link>
			<description><![CDATA[<p>Im receiving the subj error message when I go through this rails app to create a task underneath a project.</p><p>Here&#039;s the error message:<br />User(#-617021328) expected, got String(#-608364028)</p><p>It refers to the second line in the create action here:<br /></p><div class="codebox"><pre><code>  def create
    @project = Project.find(params[:project_id])
    @task = @project.tasks.build(params[:task])
    @task.status = Task.status_to_i(&#039;Not Started&#039;)
    @task.creator = session[:user_id]
    respond_to do |format|
      if @task.save
        flash[:notice] = &#039;Task was successfully created.&#039;
        format.html { redirect_to project_path(@project) }
        format.xml  { render :xml =&gt; @task, :status =&gt; :created, :location =&gt; @task }
      else
        format.html { render :action =&gt; &quot;new&quot; }
        format.xml  { render :xml =&gt; @task.errors, :status =&gt; :unprocessable_entity }
      end
    end
  end</code></pre></div><p>To associate the task with users, I have two belongs_to statements. One for who creates the task, and one for who it is assigned to. Here&#039;s the model code for that association:<br /></p><div class="codebox"><pre><code>class Task &lt; ActiveRecord::Base
  belongs_to :project
  validates_presence_of :name, :description
  belongs_to :assigned_to, :class_name =&gt; &quot;User&quot;, :foreign_key =&gt; :assigned_to
  belongs_to :creator, :class_name =&gt; &quot;User&quot;, :foreign_key =&gt; :creator
  attr_accessible :name, :description, :due_date, :creator, :assigned_to

  #... other methods
end</code></pre></div><p>Here&#039;s the form code, with the drop down for whom it is assigned to and so forth.<br /></p><div class="codebox"><pre><code>&lt;% form_for([@project, @task]) do |f| %&gt;
  &lt;%= f.error_messages %&gt;

  &lt;p&gt;
    &lt;%= f.label :name %&gt;&lt;br /&gt;
    &lt;%= f.text_field :name %&gt;
  &lt;/p&gt;
  &lt;p&gt;
    &lt;%= f.label :description %&gt;&lt;br /&gt;
    &lt;%= f.text_area :description %&gt;
  &lt;/p&gt;
  &lt;p&gt;
    &lt;%= f.label :assigned_to, &#039;Assigned To:&#039; %&gt;&lt;br /&gt;
    &lt;%= f.collection_select :assigned_to, @users, :id, :full_name_last_initial %&gt;
  &lt;/p&gt;
  &lt;p&gt;
    &lt;%= f.label :due_date %&gt;&lt;br /&gt;
    &lt;%= f.date_select :due_date %&gt;
  &lt;/p&gt;
  &lt;% if controller.action_name == &#039;edit&#039; %&gt;
    &lt;p&gt;
      &lt;%= f.label :status %&gt;&lt;br /&gt;
      &lt;%= f.select :status, Task.status_hash %&gt;
    &lt;/p&gt;
    &lt;p&gt;
      Creator: &lt;br /&gt;
      &lt;%= @task.creator.name %&gt;
    &lt;/p&gt;
  &lt;% end %&gt;
  &lt;p&gt;
    &lt;%= f.submit &#039;Submit&#039; %&gt;
  &lt;/p&gt;
&lt;% end %&gt;</code></pre></div><p>Any ideas on what may be causing the problem? It seems like a field or parameter that is passing to it is sending that number to the build call. I can&#039;t seem to narrow it down to what might be doing that.</p>]]></description>
			<author><![CDATA[dummy@example.com (agm_ultimatex)]]></author>
			<pubDate>Mon, 08 Feb 2010 23:28:35 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?id=37138&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Authorization with CanCan: newbie needs a little help]]></title>
			<link>http://railsforum.com/viewtopic.php?id=37163&amp;action=new</link>
			<description><![CDATA[<p>Hello. I am a beginner at rails and do not fully understand it. I am building a little app with a backside administration. I have used Authlogic for authenticity and am trying to use CanCan for authorization.</p><p><strong>Database</strong><br />I have a &quot;users&quot; and a &quot;roles&quot; table. The &quot;users&quot; table has a &quot;role_id&quot;. The&quot;roles&quot; table has fields &quot;name&quot; and &quot;description&quot;.</p><p><strong>Models</strong> (added lines to files)<br />user.rb<br /><em>belongs_to :role</em><br />role.rb<br /><em>has_many :users</em></p><p><strong>Issue</strong><br />In the ability.rb file, how can I pull the users role to test and set up permissions?</p><p>Here&#039;s an example. It obviously does not work. But I think that you can see where I am going with it.<br /></p><div class="codebox"><pre><code>class Ability
  include CanCan::Ability

  def initialize(user)
    if user.role.name == &#039;Administrator&#039;
      can :manage, :all
    else
      can :read, :all
    end
  end
end</code></pre></div><p>Thanks a lot guys. Sorry if it is something simple and I do not understand. Like I said, I am new and do not fully understand ruby and rails yet.</p>]]></description>
			<author><![CDATA[dummy@example.com (tuscanidream)]]></author>
			<pubDate>Mon, 08 Feb 2010 22:51:13 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?id=37163&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Only need one user...]]></title>
			<link>http://railsforum.com/viewtopic.php?id=37161&amp;action=new</link>
			<description><![CDATA[<p>Hi there</p><p>I have a simple app that only requires one user to login and perform certain admin tasks.</p><p>What is the best way to set this up. I&#039;m used to using acts_as_authenticated and Clearance in various other projects but this seems like overkill here.</p><p>Thanks</p>]]></description>
			<author><![CDATA[dummy@example.com (bongoman)]]></author>
			<pubDate>Mon, 08 Feb 2010 22:29:10 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?id=37161&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[CanCan and redirecting unauthorized access]]></title>
			<link>http://railsforum.com/viewtopic.php?id=37160&amp;action=new</link>
			<description><![CDATA[<p>I&#039;m trying to figure out a way to redirect users to appropriate pages when they try to access unauthorized pages with CanCan. For example:</p><p>- If a user isn&#039;t logged in, but attempts to access a &#039;logged-in only&#039; action, I want to redirect the user to the login page.<br />- If anyone besides an admin tries to access an &#039;admin only&#039; action, I want to redirect the user to a 404 page.</p><p>The only example I can find is:</p><div class="codebox"><pre><code> class ApplicationController &lt; ActionController::Base
    rescue_from CanCan::AccessDenied do |exception|
      flash[:error] = exception.message
      redirect_to root_url
    end
  end</code></pre></div><p>which is ugly. And within that rescue block, I&#039;d have no idea what attempted action triggered it.</p><p>Any thoughts?</p>]]></description>
			<author><![CDATA[dummy@example.com (kshet26)]]></author>
			<pubDate>Mon, 08 Feb 2010 21:44:22 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?id=37160&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Rails3 & JS Helpers with jQuery]]></title>
			<link>http://railsforum.com/viewtopic.php?id=37137&amp;action=new</link>
			<description><![CDATA[<p>In the release notes it says &quot;Unobtrusive JavaScript helpers with drivers for Prototype, jQuery&quot;</p><p>So how do I setup Rails 3 to use jQuery then?</p><p>It still loads all the Prototype libraries by default. </p><p>Also, as a bonus question, if I am using Prototype is there a way to get Rails to load the minified versions, and even better a single JS to cut down on http requests?</p><p>Thanks.</p>]]></description>
			<author><![CDATA[dummy@example.com (alexc)]]></author>
			<pubDate>Mon, 08 Feb 2010 21:44:12 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?id=37137&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[respond_to not returning rjs, only returns html]]></title>
			<link>http://railsforum.com/viewtopic.php?id=36290&amp;action=new</link>
			<description><![CDATA[<p>I am sending an ajax request that works fine in most browsers except IE on Vista.&nbsp; It works fine in IE7 on XP.&nbsp; Anyway, the ajax request returns html on Vista instead of my rjs template.&nbsp; Has anyone else had this issue.&nbsp; I have seen a few other people who have had similar problems and updated ruby from 1.8.6 to 1.8.7 and it fixed the problem.&nbsp; But their error was slightly different, Just wanted a little more clarification before upgrading my ruby.</p>]]></description>
			<author><![CDATA[dummy@example.com (kidbrax)]]></author>
			<pubDate>Mon, 08 Feb 2010 21:37:08 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?id=36290&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Modeling different types of products with different attributes]]></title>
			<link>http://railsforum.com/viewtopic.php?id=37159&amp;action=new</link>
			<description><![CDATA[<p>I have an app that I&#039;m working on that shows different products that belong to different categories.&nbsp; For sake of example, let&#039;s assume there are products such as &quot;digital cameras&quot;, &quot;mobile phones&quot; or &quot;portable gps&quot;.</p><p>Each of these is a &quot;product&quot; but will obviously have different attributes.&nbsp; I&#039;d like to be able to add a new product (with common attributes like name, description, category, etc).&nbsp; Then based the product&#039;s category, I want to be able to fill in the other attributes as needed for that category.</p><p><strong>Option 1: Use Single Table Inheritance</strong><br />I looked this up on the forum and elsewhere and saw references to Single Table Inheritance as one possible option.&nbsp; But it seems like that might not be the best approach since, over time and with a large number of categories, that would lead to a huge table full of attributes.</p><p><strong>Option 2: Use Multiple Models for Each Type of Product</strong><br />I could also create models for each type of products (Camera, Phone, Book, etc) but I&#039;d like to be able to add new categories/products from within the admin area of the site once it&#039;s live vs. having to dive into the code each time I want to add to the site.</p><p><strong>Questions:</strong><br /></p><ol class="decimal"><li><p>Any idea how to setup something like this in Rails or any other options I should consider?&nbsp; </p></li><li><p>And is there another concept I&#039;m missing that I should read up on besides Single Table Inheritance that would help point me in the right direction?</p></li></ol><p>Thanks</p><p>Kenton</p>]]></description>
			<author><![CDATA[dummy@example.com (kenton)]]></author>
			<pubDate>Mon, 08 Feb 2010 21:36:45 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?id=37159&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[uninitialized constant ApplicationController::SslRequirement]]></title>
			<link>http://railsforum.com/viewtopic.php?id=37157&amp;action=new</link>
			<description><![CDATA[<p>Hello.&nbsp; I need to use SslRequirement in my app.&nbsp; I have an environment configured with LightTPD and a self-signed cert.&nbsp; It can access all pages via HTTP or HTTPS.&nbsp; Good so far.&nbsp; But after I installed SslRequirement, it doesn&#039;t seem like it was recognized.&nbsp; When I add &quot;include SslRequirement&quot; to my application.rb file, I get this:</p><p>&nbsp; uninitialized constant ApplicationController::SslRequirement</p><p>which is what I&#039;d expect to see if the plugin wasn&#039;t installed.&nbsp; There&#039;s no way I can find to list plugins installed for an app (which is weird), but I can go into app/vendor/plugins and see that there&#039;s a directory for ssl_requirement.&nbsp; So it looks OK.&nbsp; But just to be sure, I reinstalled it.&nbsp; No change.&nbsp; My app refuses to recognize the plugin.&nbsp; Any idea what I could try next?</p><p>Thanks, Dan</p>]]></description>
			<author><![CDATA[dummy@example.com (dlamet)]]></author>
			<pubDate>Mon, 08 Feb 2010 20:51:29 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?id=37157&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[multiple controllers and models tutorial?]]></title>
			<link>http://railsforum.com/viewtopic.php?id=37156&amp;action=new</link>
			<description><![CDATA[<p>Hi:</p><p>I am a newbie. I have been playing only using 1 controller and 1 model.. Any examples out there that I can go beyond this...<br />I think an a deeper understanding of MVC is also required. </p><p>Any recommended readings and links????</p><p>Thanks</p>]]></description>
			<author><![CDATA[dummy@example.com (mo)]]></author>
			<pubDate>Mon, 08 Feb 2010 20:40:27 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?id=37156&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Transaction history saving in database]]></title>
			<link>http://railsforum.com/viewtopic.php?id=37155&amp;action=new</link>
			<description><![CDATA[<p>Hi,</p><p>I am new to Ruby. I am developing an app in which an admin can add (create) employees. There are multiple admins in my application. I have created a new database table called &quot;transactions&quot; in which one can refer the table in the database and retrieve information on which admin added which employee. Can anyone give me any ideas on how to proceed for this? </p><p>As an example, </p><p>1)&quot; Admin1&quot; creates a user called &quot;user1&quot;. <br />2) &quot;Admin 2&quot; updates existing information on &quot;user1&quot;<br />Once this has been done, in the transaction table, it should look like: </p><p>transaction_id&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; user_id&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;transaction_type<br />1&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; id of &quot;Admin1&quot;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;create<br />2&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;id of &quot;Admin1&quot;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; update</p><br /><p>Can anyone please guide me through this?</p><p>Thanks</p>]]></description>
			<author><![CDATA[dummy@example.com (babbu452002)]]></author>
			<pubDate>Mon, 08 Feb 2010 20:39:46 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?id=37155&amp;action=new</guid>
		</item>
	</channel>
</rss>
