josevalim/inherited_resources — Issue #190: Bug in 1.3.0 version
Author: link-er
Created: 2011-12-26 11:30:09+00:00
State: open

Hello
In my app I use inherited resources and after last update I got some errors, that gone after rollback to 1.2.2 version.
Here is the problem. I have base controller SubdomainBaseController, that is parent to another controller FeedbackMessageController. SubdomainBasecontroller:

class SubdomainBaseController < InheritedResources::Base
layout "subdomain"
before_filter :authenticate_user!
before_filter lambda{ I18n.locale = current_user.locale }
before_filter lambda{SimplesIdeias::I18n.export!}

def index
@activities = current_account.activities.order("activities.created_at desc").page(1)
super
end
end

FeedbackMessageController:

class FeedbackMessagesController < SubdomainBaseController
load_resource :feedback_message
respond_to :js

def create
@feedback_message.user_id = current_user.id
create!
end
end

I have a remote link for new action, that renders dialog with form. Here is form for feedback_message:

<%= semantic_form_for @feedback_message, :validate => true, :remote => true do |f| %>
<%= f.inputs do %>
<%= f.input :name %>
<%= f.input :description %>
<%end%>
<%= f.buttons do %>
<%= f.commit_button :button_html => { :disable_with => "#{t('share.wait')}", :id => "submit_with_subscribers" } %>
<% end %>
<% end %>

And somehow I got as url for this form subdomain_bases_path and ofcourse I got error, because there is no such path. Then, I tried to find out how this is hapenning and I found that instead of new feedback_message object in new action I have SubdomainBase object O_O. I even don't have such model! And this objects had columns from another model, Account. So...I have no ideas how this might happen.