# Need help on writing a plugin

**URL:** <https://www.ruby-forum.com/t/need-help-on-writing-a-plugin/112090>\
**Category:** Rails\
**Created:** [August 15, 2007, 7:55am UTC](https://www.ruby-forum.com/t/need-help-on-writing-a-plugin/112090 "2007-08-15T07:55:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![patcito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/50afbb/32.png) [@patcito](https://www.ruby-forum.com/u/patcito)\
**Post date:** [August 15, 2007, 7:55am UTC](https://www.ruby-forum.com/t/need-help-on-writing-a-plugin/112090/1 "2007-08-15T07:55:40Z")

</div>

Hey all,

I’ve just “script/generate plugin my\_plugin” and I would like to  
“overload” one of my view. Say I have app/views/sessions/new.html.erb  
and I would like to rewrite that file without touching it using the  
plugin. Any idea how to do this? I would also like to do the same  
thing with models and controllers of my application. I couldn’t find a  
tutorial about this so I would appreciate it if you could point me to  
one.

Thanks in advance

Pat

---

<div class="post-metadata">

**Author:** ![patcito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/50afbb/32.png) [@patcito](https://www.ruby-forum.com/u/patcito)\
**Post date:** [August 16, 2007, 12:59pm UTC](https://www.ruby-forum.com/t/need-help-on-writing-a-plugin/112090/2 "2007-08-16T12:59:47Z")

</div>

On Aug 15, 6:55 am, “Patrick A.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Pat

It sounds like you’re looking for some of the functionality that the  
engines plugin provides. You can find out if it’s suitable for your  
particular project here: [http://rails-engines.org](http://rails-engines.org).

–  
James

---

<div class="post-metadata">

**Author:** ![patcito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/50afbb/32.png) [@patcito](https://www.ruby-forum.com/u/patcito)\
**Post date:** [August 16, 2007, 6:02pm UTC](https://www.ruby-forum.com/t/need-help-on-writing-a-plugin/112090/3 "2007-08-16T18:02:35Z")

</div>

ActionController::Base.view\_paths might be what you’re looking for.

For models, you would want to push your plugin’s model directory in  
very front of config.load\_paths

However, I don’t buy the idea of having same models at 2 places.

On 8/15/07, Patrick A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks in advance
> 
> Pat
> 
> >

–  
Cheers!

- Pratik  
[http://m.onkey.org](http://m.onkey.org)
