Working on Rails Engine.

I want to make the controllers customizable whereever the Rails Engine is
used.

Therefore, I was trying to use `extend ActiveSupport::Concern` on the
Engine controller class and include it in MyRailsApp.

https://gist.github.com/4185823

# code in my rails engine

moduel MyEngine
class SomeController
extend ActiveSupport::Concern

def engine_some_method
end
end
end


# code in my rails app where engine is implemented

class SomeController
include MyEngine::SomeController

def app_some_method
end

# code that's available by including the Rails Engine code
# def engine_some_method
# end
end

But, this breaks my rpsec controller tests because of an undefined
"recycle" method.

12) Qe::Admin::QuestionPagesController POST reorder
Failure/Error: xhr :post, :create,
NoMethodError:
undefined method `recycle!' for
#<Qe::Admin::QuestionPagesController:0x007f80aa1c7528>
# ./spec/controllers/admin/pages_controller_spec.rb:69:in `block (2
levels) in <top (required)>'

When I comment out the "include MyEngine::Controller" everything passes.

Why?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/ViCnX2HqSPkJ.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 7 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedDec 1, '12 at 11:19p
activeDec 9, '12 at 4:25p
posts7
users2
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2023 Grokbase