It would be great to have helpers like linkTo()
, truncate()
, and pluralize()开发者_如何学Go
in Javascript. Have there been any efforts to port some or all of Rails' view helpers to Javascript?
If you just need one or two, you can find snippets for pluralize and singularize or another for truncating.
And actually, there's now a javascript library that handles a lot of the syntactic sugar:
Sugar.js
Like I said in my original post, no need to include a whole library if you only want one or two of them or can manage to just use the Rails helpers, but the option to have them is out there.
精彩评论