[Masterview-devel] MasterView generation from existing rhtml

Jeff Barczewski
Mon, 26 Jun 2006 16:30:16 -0000

Yes, I think what you mentioned could work but the only when I was thinking
through this a while back I was having trouble figuring out how to know what
all pieces (rhtml partials and layouts) to pull in. Honestly I didn''t
spend
much time looking at it but it did seem like it would be a nice thing to do
if possible.

I will put it on the todo list.

Thanks for the idea and approach.

Jeff

On 6/26/06, Sergey Shalatskiy <sshalatskiy at guerillaviralmarketing.com>
wrote:
>
>  Jeff,
>
> Thanks for a quick answer. It helped a lot.
> Regarding the issue with generating html from rhtml, I don''t see
why it
> can be difficult. If the difficulty you see is in converting the erb
> statements, you could use erb itself, I believe, by replacing standard
rails
> methods for things like
> error_messages_for, or any other methods that have equivalents in
> MasterView directives, by masterview proxies that generate its own output
by
> converting them into directives. Basically, it seems to me, you just need a
> reverse method for every directive. The rest is to combine everything in a
> template and generate html per every rhtml.
> Not sure, though, what to do with rjs files, if anything.
> Although, maybe I oversimplify things here.
> Does it make sense to you?
>
> Thanks,
>
> Sergey Shalatskiy
>
>
> ----- Original Message -----
> *From:* Jeff Barczewski <jeff.barczewski at gmail.com>
> *To:* Sergey Shalatskiy <sshalatskiy at guerillaviralmarketing.com>
> *Sent:* Monday, June 26, 2006 1:22 AM
> *Subject:* Re: MasterView generation from existing rhtml
>
> Sergey,
>
> I haven''t come up with a way to take existing rhtml and create
xhtml from
> them. However you can co-exist with existing rhtml nicely. You can have
some
> thing in masterview templates and other things in simple rhtml and use both
> interchangeably in your project.
>
> If you want to view the generated rhtml files simply to see what
> masterview is generating behind the scenes then simply do rake
mv:view_rhtml
> RHTML=store/list.html and it will output to stdout.
>
> If you want to generate the files to the filesystem so that they will be
> loaded from there then you can change the  setting in
> config/masterview/setting.rb like so
> config.generate_rhtml_files = true
> When this setting is set it will generate rhtml to the file system and it
> will be loaded from there just like your existing rhtml.
>
> Refreshing the browser will reparse the template (and regenerate the
> rhtml).
>
> You can also kick off rhtml generation from the command line using rake
> mv:parse
>
> Let me know if this all makes sense and answers your questions.
>
> All the best,
>
> Jeff
>
>
> On 6/25/06, Sergey Shalatskiy <sshalatskiy at
guerillaviralmarketing.com>
> wrote:
> >
> >  Hi Jeff,
> >
> > MasterView is excellent! Just a couple of questions:
> >
> > Is it possible to generate (x)html from existing rhtml etc. ?
> > It is very important if someone wants to switch to masteview from
> > regular rails apps.
> > Possibly, it would be also convenient to have an option to use
existing
> > files without regeneration, as you mentioned in one of your messages
on
> > forum.
> > Also, I was not able to generate rhtml files from masterview
templates.
> > How do I do that? It looks like in order to smoothly upgrade existing
> > projects,
> > we need roundtrip options. It will help a lot to understand the
> > framework better and switch to MasterView quickly. Complex
applications will
> > require a lot of manual
> > work if there is no such options.
> >
> > Thanks
> >
> > Sergey Shalatskiy
> >
>
>  ------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.394 / Virus Database: 268.9.4/375 - Release Date: 6/25/2006
>
>
-------------- next part --------------
An HTML attachment was scrubbed...