What I've been doing lately is generating show/edit templates server side
and then pulling the html out of the dom with javascript on page load.
Something like this:
<div class="content">
blah blah blah
</div>
<div class="show" style="display:none">
Name: <span class="name" />
</div>
<div class="edit" style="display:none">
Name:<input class="name" type="text" />
</div>
<script>
$(document).ready(function(){
var templates = {
show: $('.show').remove(),
edit: $('.edit').remove()
};
});
</script>
I then append show or edit templates as needed.
On Tue, Dec 8, 2009 at 3:24 PM, Julio Cesar Ody <[email protected]> wrote:
> Except that with node.js, and I believe that's what you're talking
> about when you mentioned JS on the server side, that would be entirely
> possible, niceties of Haml included (or rather, intrincasies of
> JS-based templating excluded).
>
> http://github.com/creationix/haml-js
>
> whereas I don't think that applies for just a regular browser. I
> wouldn't mind actually seeing what maybe I just think it's a
> limitation being a non-issue.
>
>
> On Tue, Dec 8, 2009 at 3:17 PM, Tim Lucas <[email protected]> wrote:
> > On 08/12/2009, at 2:46 PM, Julio Cesar Ody wrote:
> >
> >> Also Myles, your plugin is nice and Imma let you use it. I think
> >> though that a substantial amount of markup being maintained both
> >> through a JS-based templating language and server side is pants.
> >
> > There's two solutions to that problem: don't do any templating on the
> > server-side; or, write your server-side in JS and use the same
> > template code on both server and client.
> >
> > -- tim
> >
> > --
> >
> > You received this message because you are subscribed to the Google Groups
> "Ruby or Rails Oceania" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> [email protected]<rails-oceania%[email protected]>
> .
> > For more options, visit this group at
> http://groups.google.com/group/rails-oceania?hl=en.
> >
> >
> >
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Ruby or Rails Oceania" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rails-oceania%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rails-oceania?hl=en.
>
>
>
--
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Dave Newman | @whatupdave | http://snappyco.de
--
You received this message because you are subscribed to the Google Groups "Ruby
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rails-oceania?hl=en.