[Erector-devel] rails generators (the second)
list1 at gjunka.com
Mon Apr 6 05:12:37 EDT 2009
I have just a general comment. I think that keeping Erector as easily
installable in Rails as possible should be the priority. I don't know
how often Erector is used outside of Rails but I guess that Rails is
still the driving horse for Erector. Newcomers to Rails or Erector
should just be able to issue one command, eventually add one line to a
configuration file, and start using it without any issues. I think that
HAML could serve here as a good example. So whatever you decide to do
with the integration between Erector and Rails, please don't throw out
the baby with the bath water ;-)
Brian Takita wrote:
> Thank you Kristian. We are in the process of deciding what to do
> regarding packaging Erector and Rails integration.
> Would everybody else like to chime in on this?
> On Sun, Apr 5, 2009 at 11:30 PM, kristian <m.kristian at web.de> wrote:
>> just thinking about it again. maybe things become a bit cleaner and
>> worth considering it if there are two gems:
>> like you have it with rspecs, rspecs-rails. the latter has the all the
>> rails specific code and would be the right place for a few generators.
>> for example I still look for a nice way to test/spec my widgets, I
>> guess I have to look at the erector test once.
>> regards Kristian
>> On Mon, Apr 6, 2009 at 10:29 AM, kristian <m.kristian at web.de> wrote:
>>> I once had this topic again but it was turned down in favour of the erect tool.
>>> but I need to get to it again. time passed and the way I use erector
>>> is beyond what the default generator and erect are doing.
>>> the best is to have a look at my personal sandbox
>>> why I think an erector generator is better than the combination rails
>>> default generator + erect:
>>> * rerun the generator allows to identify modified files, you can have
>>> look at the diff and decide whether you want to overwrite them or not.
>>> rails default generator + erect you do not get that feature
>>> * erector is more elegant then just replacing erb files with erector widgets
>>> the above generator uses datamapper instead of activerecord that is
>>> why things like the error messages are a bit strange. anyways what I
>>> do here is to offer two base widgets for displaying data models. for
>>> each restful resource I have 4 view files: new.rb, show.rb, edit.rb
>>> and index.rb. the first three reuse the MyModelWidget and the index.rb
>>> uses MyModelsWidget (the list of model entities). with this all four
>>> files are very small and on top you can use the MyModel(s)Widgets at
>>> other places where needed. so basically using a composite pattern to
>>> setup the views.
>>> so in my opinion this would help to show the potential which lies in
>>> erector. since the above is my personal sandbox is carries some extras
>>> which is not needed for a public, but if you guys change your opinion
>>> about erector generators I can provide them. if you do not like my
>>> approach that is also OK for me since I am using erector all over the
>>> place and I am about to migrate even two more small projects to use
>>> erector (most probably using my generators and regenerate some code
>>> with it)
>>> with regards Kristian
>> Kristian Meier + Saumya Sharma + Sanuka Meier
>> Vadakkethu House,
>> Edayanmula West PO - 689532,
>> Pathanamthitta District, Kerala, INDIA
>> tel: +91 468 2319577
>> protect your privacy while searching the net: www.ixquick.com
>> Erector-devel mailing list
>> Erector-devel at rubyforge.org
> Erector-devel mailing list
> Erector-devel at rubyforge.org
More information about the Erector-devel