具有自定义类型的 Rails CMS

发布于 2024-12-06 18:38:39 字数 298 浏览 0 评论 0原文

我来自 .NET 世界,也有一些 PHP 背景。 我目前正在 Ruby on Rails 中进行开发,并且使用 Rails 3.1 和 Ruby 1.9.2。

我一直在研究 Rails CMS,但没有找到我一直在寻找的东西。

我正在寻找的一项功能是能够使用自定义字段创建自定义类型,就像我可以使用 .NET 上的 Sitecore 和 N2CMS 以及 PHP 上的 Drupal 和 Joomla 一样。

Ruby on Rails 上有没有什么好的替代品具有这种能力? 如果没有,在任何 Rails CMS 中是否可以轻松实现?

I come from the .NET world and have some PHP background as well.
I'm currently developing in Ruby on Rails and I'm using Rails 3.1 and Ruby 1.9.2.

I've been researching about Rails CMSs, but haven't had much luck with what I've been looking for.

The one feature that I'm looking for is the ability to create custom types with custom fields, as I can do with both Sitecore and N2CMS on .NET, and both Drupal and Joomla on PHP.

Are there any good alternatives on Ruby on Rails that possess this ability?
If not, is it easily achievable in any Rails CMS?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

夏天碎花小短裙 2024-12-13 18:38:40

我也经历了同样的挣扎,最终在 Rails 之上从头开始自己构建一些东西——这比我想象的要容易得多。

例如,我所有的普通页面都按如下方式路由:

get '/:slug' => 'page#show', as 'page_path'

但我也有自定义数据类型,例如“事件”。这些是他们自己的模型,因为我此时仅通过 ajax 与他们交互:

get '/events/:year/:month' => 'events#get_by_year_and_month, :as => 'get_events_by_year_and_month'

所有内容编辑都受 Devise 保护,位于 :admin 命名空间后面:

namespace :admin do
  resources :pages
  resources :events
end

等等。如果您不太熟悉 HTML 和 CSS 来为管理内容构建漂亮的 UI,那么这可能不是一个好主意,但是有大量的模板和示例。

I went through this same struggle, and just ended up building something on my own from scratch on top of Rails—it was a lot easier than I thought it'd be.

For example, all of my normal pages get routed like this:

get '/:slug' => 'page#show', as 'page_path'

But I also have custom data types such as 'events'. These are their own model, and as I only interact with them via ajax at this point:

get '/events/:year/:month' => 'events#get_by_year_and_month, :as => 'get_events_by_year_and_month'

All of the content editing is protected by Devise, behind the :admin namespace:

namespace :admin do
  resources :pages
  resources :events
end

And so on. If you're not comfortable enough with HTML and CSS to build a nice UI for the admin stuff, it may not be a great idea, but there are plenty of templates and examples out there.

作死小能手 2024-12-13 18:38:40

我最近使用名为 Refinery 的 CMS 构建了一个网站。 http://www.refinerycms.com

在Refinery中,您可以构建自己的引擎来根据需要处理自定义类型/字段。以下是他们如何实现这一目标的快速入门指南:

http://refinerycms.com/guides/getting-started-with-refinery#extending-refinery-with-your-first-engine

Refinery 的唯一缺点(imo)是如果你公开部分代码以便可以自定义它(通过将部分(视图、控制器等)从 Gem 复制到正常的 Rails 应用程序目录结构中来实现这一点),那么它会给你一个绊脚石将精炼宝石更新为新版本时。

I recently built a site using a CMS called Refinery. http://www.refinerycms.com.

In Refinery, you can build your own engines to handle custom types / fields as needed. Here is their quick start guide on how to achieve this:

http://refinerycms.com/guides/getting-started-with-refinery#extending-refinery-with-your-first-engine

The only downside to Refinery (imo) is that if you expose part of the code so you can customize it (you do this by copying parts (views, controllers, etc.) out of the Gem and into your normal Rails app directory structure), it then gives you a stumbling block when updating the Refinery Gem a newer version.

内心旳酸楚 2024-12-13 18:38:39

查看机车

它具有自定义内容类型

Check out Locomotive.

It has Custom content types.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文