ruby on rails - Creating Views In Gem -



ruby on rails - Creating Views In Gem -

i do:

bundler new "gem_name"

this creates basic construction gem.

cd "gem_name"

now in directory, tld of "gem_name"

beneath create app/views/hello_world.html.erb view load other projects if require gem via

gem "gem_name"

i fill out

"gem_name".gemspec

with required information, , do

rake install gem list

confirms "my_gem" there.

so create new app, , go gemfile of new app, , come in "my_gem" in gem file. bundle install there. don't see view files added in gem (but dependencies of gem loaded new app). how load these views gem?

ideally load right app views directory ( can namespace later, testing atm,..) without need generator. thanks

with regard getting hold of views in gem, looks if have views stored 'app/views/' @ base of operations of gem, rails should pick subsequently when render view if had file within views directory of app!

hope helps!

trying phone call view gem

ruby-on-rails ruby gem

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -