Refinery CMS to do mini-CMS - ruby-on-rails

Just curious: I have to do a mini-CMS that allows users to add "pages" using a template. Each of the produced pages has/is an entry form and a "received" page.
I can visualize this in Rails pretty easily, but I'm wondering if there's any advantage to using a CMS like Refinery. Thoughts?

I was supprised to see Phil Arndt's answer voted down - I guess that it's hard to gain trust if you're involved in the product you discuss.
As for your question: sure you can build that site yourself, and most likely it will be simpler and will cost you less time than diving into the RefineryCMS documentation.
However most likely this site will evolve, your client will come up with more requirements, and it'll become harder to keep up with the complexity of the project.
Further more, you'll get more similar questions from other clients. Similar, but not identical, an you'll have to start from scratch every time.
A cms framework such as Refinery becomes an interesting choice at that moment. A framework gives you bigger building blocks than the Rails framework itself, so you can build faster. You won't have to reinvent the wheel for every customer request, since it will often be similar to what other people have built and shared (the "engines" in the case of Refinery). So the time you invest to learn to use the framework will pay off.
So in your case, even if you've already implemented your mini-cms, I'd consider redoing it in refinery or another framework CMS before you end up building your own CMS in which you'll have to duplicate all of the work already done for other CMSes...

One advantage to Refinery is that it has a very active (and growing) community of developers with an increasing number of 'engines' built to handle custom requirements. Also, by using an open source solution you have the opportunity to join in by providing patches for anything you think could be improved.
Another new advantage to Refinery is that it can hook straight into an existing application by following the very few steps in the integration guide.
Of course, this is all in addition to the fact that it aught to save you a lot of time as this use case has been carefully thought out over years of development with over 105 contributors and a large number of websites running smoothly in production.
Cheers,
Phil

Related

Another rails upgrade dilemma

soliciting advice about upgrading (or re-writing?) a legacy app. It's a single page webapp with lots of dynamically generated windows and forms, roughly comprised of
13,000 lines in .rb files
11,000 lines in .erb files
25,000 lines of javascript (not including large 3rd party libraries that bring this to nearer 60000 lines)
This acts as a UI for end users of our system, which also has a number of core business services (mostly written in Java, with a small amount of Node.js) and a fairly sizeable MySQL database (>200GB). Some of these services push AJAX to the client browser for real-time updates.
Reasons for upgrade
It's ruby 1.8.7, rails 2.3.15. Most of the core code dates from 2009. This makes it both insecure and hard to maintain (think "predates the existence of gemfiles".)
The app has been maintained by Java devs for most of its life, as most of the company's devs have been hired as Java devs to work on all the other services that perform business logic. It's probably safe to assume that this has lead to lots of hacks from people who didn't want to break anything, and certainly lots will not be done in a "rails way".
The javascript is also a bit of a mess. It's got a knot of frameworks (the original Angular is used sporadically; jquery and prototype are both fighting over the $ symbol in different places.) There are files that are 7000 lines long.
the css styling has been upgraded since 2009(!) but is starting to look a little tired. We'd like to implement a bootstrap theme that will look sharp without too much front-end skill, but right now the code that renders all of our pop-up windows, sidebars etc breaks badly if we try and add bootstrap.
It would be nice to modernise our push servers, replacing them with websockets.
Context
There are 3 of us on the dev team- this is my first job, and I've only been here since January. Of the other two, one has only been here about 4 months longer than me, and it's his first dev job too. The other guy is the only one who has ever spoken to someone who spoke to someone from the original team.
Oh, and of course we have little or no test coverage.
Options
When I was hired (as a Java developer), I was told that we were looking to replace the website with one based on Spring MVC. This effort is partially underway, having been attacked in drips and drabs over a couple of years. Because different devs who never met have attacked it as if it's their own brand new project, the same problems are solved in different ways in different places. They've tried some flashy techniques such as custom annotations that I find hard to follow, but as far as I can tell don't fully work. The most senior of us estimates it would take our team a year's dedicated full-time work to finish it (which is not a realistic business proposition, based on how many requests for new features we get from customers).
I'm inclined to upgrade the website rather than spin out a new one. This is partly because I can see the sense in that post. Another reason is that we're all employed as jack-of-all trade full stack developers (doubling as DBAs, sysadmins, etc...). We've got no particular expertise in UI design, and the UI for our present interface, although dated, is pretty user-friendly; it feels like a blank canvas would throw that structure out, and play to our weaknesses. Upgrading ruby/rails would also make any features we add during the upgrade much easier to add to the new site.
Apparently some experienced ruby devs who are friends with my boss have advised him informally it'd be so much work to bring the website up to date that it would be comparable to a complete re-write, which was the motivation for the spring project. This would have the advantage of only having to think about Java + javascript, and not trying to hire people who know both Java and ruby well.
Conventional wisdom seems to be upgrade rails in stages. I'm not sure how well this would work for us, for 2 reasons. For one thing, there 3 major versions for us to upgrade, which might have significant changes between them. More importantly, the code needs some TLC anyway with refactoring and the creation of a test suite.
I'm inclined to follow the following strategy:
Invest some developer time in training, to get a sense of the relevant best practises and the "rails ways" of doing things, rather than the "good enough to hack" knowledge most of us have now.
fire up a new rails 5.1 project on ruby 2.4.0
Configure active record to use our old database
Copy across the javascript from the public folder of the existing project in to the relevant parts of the asset pipeline and save that headache for "phase 2".
Sort out a gemfile with updated versions of our dependencies (for example, mysql gem has been replaced by a mysql2 gem.) Installing rubocop seems like a good idea at this point.
Copy files across from old to new project one at a time. Read the code, figure out what it's doing, write the relevant tests, fix where they break. Use the ruby API and rails upgrade guides to update the syntax. Refactor until rubocop is appeased.
Once we've reproduced the functionality of the existing site, write a new stackoverflow post on how to sort out the javascript ;)
This certainly sounds like a lot of work, but seems less likely to produce a buggy mess than trying to reproduce our existing functionality from scratch in a different language. So...
Questions
Does this strategy seem sensible? Is this a case where the re-write is really a better option? Is tackling the JS separately the best call, or is it better to restructure it as we're examining the calls to it from the views? Or should we really upgrade -> 3.0, 3.1, ... 5.0, 5.1?
We've altered the database manually, adding new tables, new fields and whatnot directly rather than using .rails generate. 'Rails magic' seems to make this work at present, but should we anticipate problems in step 3?
Is there any logical order in which to approach the migration of ruby? As there's major changes to the routing, which is the central entry point of the application, it seems sensible to start there, followed by authentication, then the main page, and then add functions one at a time.
Part of the problem is "not knowing what we don't know" about the rails way of doing things. Apart from the canonical Ruby/Rails tutorials (Hartl, Ruby Monk, Ruby Koans, Kehoe's rails book), is there any essential reading we should be aware of before trying to take on such a large job? I'm especially thinking about things that may not be immediately obvious, like proper use of helper functions, module structure, etc.
Any other advice, comments, prayers, ... welcome!

Can Wordpress be replaced by a Framework like Django or Ruby on Rails?

I consider myself a well trained WordPress template developer, and i recently started to read books and documents about web app frameworks, particularly Django and Ruby on Rails. I didn't know any of the two languages, but i have no problems to learn another one or two. I really don't get the real benefits of using a framework, because i feel very confident about the power of WordPress. So, can anyone tell me the real benefits of using a framework? For example, Pinterest is made using Django, but i think that i can achieve the same results with a WordPress template using Javascript and CSS3. Can anyone tell me the differences/benefits of using a framework in that particular case?
You can achieve the same frontend with Wordpress, but what you will not be able to achieve is the speed and scale - and most importantly, maintainability - of an application based on a more application-oriented architecture.
Wordpress is highly flexible, but it's also slow, and needs an awful lot of TLC to be able to operate at any kind of significant scale. Its design allows for very flexible runtime modification of behavior, but this is also a bit of a Pandora's Box, since it means that code can end up running all over the place for any given page, which makes maintenance a nightmare.
Wordpress is extremely good at being a CMS, but once you start to push it outside of those bounds, you get into trouble, and find yourself having to write your own more abstract framework that runs inside of the context of Wordpress to be able to fulfill your application's needs.
That said, if you have an application that you can build in the context of Wordpress, I'd say go for it! Wordpress can be a wonderful tool for building a proof-of-concept or MVP. If it gets you up and running, then it may be the right choice over writing a full application. However, just be aware that you're going to hit some brick walls as your product design matures and your audience grows, unless your application fits within a rather narrow set of design requirements, so long-term, you may find yourself having to move to a custom application.
Credentials: I've spent the last couple of years maintaining a Wordpress install that served over 25 million monthly uniques, and we had to get very clever to keep it running. We've since replaced it with a Rails application that serves pages somewhere on the order of 10x-30x faster, and is significantly more extensible as an application, allowing us to start exploring application potential that we really couldn't get with Wordpress.
I once made the decision while working in some start-up to choose WordPress for an advanced e-commerce, community-driven marketplace.
It was an awful decision
This is how I was feeling:
At the beginning, it was looking good - you have an amazing community, plugins for everything etc. But sooner than later I hit the wall - at it's root - WordPress is a blogging platform!
Every piece of content technically is a post.
It's really hard to create advanced item relationships
Functionalities are not consistent. Some functions work one way, while others that seems to be very similar work in a different way. Sometimes you need some weird hacks to achieve task that seem to be simple. It makes you read the docs very often to see how a function that you're using for the 1000th time is working. (However, to be honest, I need to say that the WordPress documentation is great!)
The WordPress community is doing a great job, but compared to any regular Framework there is one main difference - Frameworks are just frameworks - they're a set of tools and those tools are there to help you do your project. WordPress already is trying to be something that you might then change.
I'll never again use WordPress for anything that needs some organised, custom functionality.
I'm actually quite impressed with what people has created with wordpress - so if you want to, it is possible and good luck!
It however often feels like buying a truck and rebuilding it to be a house. There are better ways to build a house.
I want to offer a dissenting opinion, even though I upvoted the top answer.
Is Rails really special?
Rails was created by David Hansson who extracted it from Basecamp, software that's replicated in a free Wordpress plugin, WP Project Manager. I think that's a pretty good indicator that Rails developers are underestimating PHP and Wordpress.
MVC and WP
True, it doesn't follow an MVC pattern. But if you use hooks, separate logic (in plugins) from views (in templates), then you'll have good code separation. (Also hint: custom post types are like models.)
Framework vs Application
As you can see, Wordpress can be treated like an application or a framework. It is an application, with all the components you'd expect to find in a framework. Right out of the box you have security, authentication, and extendibility. And it's meant to be extended.
Scaling
WP powers 18% of the internet's websites, including TechCrunch, Smashing Magazine, and (parts of) CNN. Seems there are ways to make WP scale. Disclaimer: I have no experience working on megasites like these, so I'm offering mere conjecture.
WP Future
The current abition of the WP community is to shift WP from a CMS to a framework. I think it's a natural progression considering that all the pieces are in place. And the Wordpress community is going strong.
Not really an answer, but a hint:
http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks
As if you can replace it completely... I think it is mostly a matter of logic flow. It depends how much imperative (Ruby on Rails) vs. descriptive (WordPress) programming you intend to do.
I don't think wordpress can replace rails, because wordpress have limited set of API and support as you compare it with RoR. Though wordpress is powerful tool for blogging application, but the same effect can be achieved with rails using gems like,
Radiant CMS,
Refinery CMS,
Locomotive.
Adding the power like ttd that can be done vary easily with rails is very difficult with wordpress.
Same with authentication and authorization mechanism like devise and cancan. There is no easy option to do the same with wordpress.
Rails make the programmer's life easier. For whole web app I will always prefer to go with the rails.
Wordpress cannot replace X framework, but the two can certainly complement each other.
For example a WP front end serving up CMS content with an attractive theme is pretty hard to beat; proxy to a back end server for custom content and voila, best of both worlds. Otherwise, WP will inevitably fall short of meeting every requirement and you'll find yourself going down the square-peg-round-hole rabbit hole, a painful place indeed; that's where X framework comes in, filling in the WP gaps.
The notion that WP does not scale may have some truth to it, but for the general case, the 95%, it will handle whatever you throw at it, particularly with WP Cache or other caching plugin thrown into the mix.
Some may say, well, you can build WP with Django or RoR! Heh, heh, you first ;-)
FWIW, I avoid dynamic language frameworks in favor of their statically/strongly typed counterparts. Use WP for the bling, and static X framework for the speed/scalability/safety. Of course, that's a matter of preference, clearly some prefer runtime flexibility over compile time safety. I'm fully in the latter camp these days...
In the simplest term,, I always want to put it like this...
You can use a framework to make WordPress it self and better
But you can't use WordPress to make a framework
Wordpress is a great CMS any way
Pros
1. We can easily set up a website using free themes and plugins
2. There are numerous number of plugins to extend our website functionality
3. Excellent Community support
4. The CMS uses PHP and MySQL, somewhat easy to lean
Cons
1. Updating plugins and themes regularly.
2. Slow
3. Malicious files can be easily injected.

How to organize a Rails App

For the first time I'm creating a quite complex Rails app.
I'd like to know what's the best way to organize that app by folders. Until now, I'd do everything under one app (all the models, controllers, etC) but reading some open source code I realize that they put everything under different apps.
Like for example Spree Commerce. They have a general folder and inside that they have different apps (API, core, admin, etc). How is that done and is that the best way to do it?
I'd like to get pointed to the best way to do it (a book, blog, anything) so I can understand how I can architect my app for future maintenance.
thank you
As an aside I think the title of your question is a little confusing. Rails, by using convention over configuration, defines 'how to organise a Rails app'. I think your question is rather about how to architect your application as opposed to anything Rails-specific. Maybe tweak the title?
That aside, without knowing any more detail about your project it's a tricky question to answer, but I'll give it a go.
All applications should start off simple, if you believe (like I do) that you should start by building the simplest thing that could possibly work. Given this, since you're using Rails, then in all likelihood the simplest thing would be to structure your app as a vanilla Rails 3 application. This will probably (I say 'probably' because I don't know any specifics about the app) allow you to get a beta version of your app up and running pretty quickly without worrying about complexities which at this stage in the development of your project are not a problem.
If you need to create an XML or JSON-based API then Rails makes this really easy using the standard framework, which will allow you to spend more time thinking about the API design than how to code it, and it's the API design which is the most important thing to get right in the first instance.
Similarly, your Admin site can be part of the same app just in a different namespace. If you find later down the line that you want it as a separate app, you can do this (maybe you could use the awesome API you designed to facilitate this), but why bother designing it with this added complexity (and hence extended development time) in the first place if you don't have a good reason for doing so?
Once you have your app up and running and people are starting to use it, you start to get a picture of where the bottlenecks are and where the design could be improved. At this stage, if there's a need, you can start to move parts of the app to scalable solutions, such as running your API as a standalone service, introducing caching, changing data stores and other improvements and optimisations.
Even if your app is as wildly successful (and I hope it is!) then re-architecting your application whist continuing to run the existing service is still entirely possible, as Twitter have proved. Just stick to Knuth's statement and you'll be alright.
Regarding reading material, that's a tricky one. For me a lot of the XP and agile development classics taught me a huge amount about how to approach program and app design. I'd also check this StackOverflow topic for book inspiration.
Good luck!
Spree uses Rails' Railties (Rails::Engines). Railties are introduced in Rails 3 to make it more modular and easy to extend. Rails 3 itself is a collection of Railties (ActiveSupport, ActiveModel, ActiveRecord, etc.).
If you are developing a complex app I would suggest spending some time planing its' architecture. Designing a complex app without any initial planning would definitely end with a maintenance nightmare down the road. It also introduces a huge learning curve for the new team members, slow down your new feature introduction and of course, frustration.
Anyway, don't over optimize, but don't forget to design your architecture for your needs.
IMHO, I will create very complex projects as one app. I have reason to believe that Spree and Radiant build under seperate apps so that under the pretense of their open source communities, contributors can contribute code easily without tampering with the core data, and the core workings of the application.
Otherwise, you should be alright just building it as one app. Just keep it neat.
Here is what have kept me sane for several years of RoR development:
I use Rails Engines, but keep them in same codebase as the main app. Here is good starter for modular Rails app:
https://github.com/shageman/the_next_big_thing
Wherever I can I try to reduce coupling and use composition to make things easily testable, reusable and maintainable. This helps to eventually extract module or engine as separate gem. Composition is done by routes (mounting), directory overlaying (assets), dependency injection or configuration.
If I don't need to re-use an engine I put it in the same code base as the main app which is single deployment unit. Thanks to that I don't need to switch between projects in my IDE. While in development environment any changes to the engine code are instantly picked up by Rails reload mechanism.

Which web framework for someone who wants a job?

I want to learn a framework that promotes good programming practices and is respected by the programming community.
However, I also want a framework that I can use for a day job.
Which one would you recommend?
This question comes from my experience of learning the basics of Django because it was highly acclaimed by developers on Stack Overflow and Hacker News. However.. there's hardly any jobs in my area (NYC) that are asking for Django developers.
As a long-time ASP.NET guy, I've recently gone through a similar decision process to figure out what other web frameworks I should try. Here's what I learned so far which may apply to your case too:
framework/platofrm choices (and hence job opportunities) are highly regional-- the Bay Area job market differs alot from what you'll find in NYC, Chicago, Montreal, or London. Look at local job listings (craigslist and indeed are good places to start) to get a good sense at what's in demand.
similarly, usage varies alot based on the size and type of company. if you want to get a job in a large company, Spring MVC and ASP.NET MVC may be your best bets. In small companies, DJango and (especially) Rails seem to be on the rise.
usage also sometimes varies by industry. for example, many HR apps seem be to .NET based, while financial/banking apps seem to favor Java. if you want to work in a particular industry, check out what up-and-coming companies in that industry are using.
when investing your scarce time in learning something new, favor technologies which are on the upswing of the adoption curve (e.g. Rails) rather than frameworks with wider adoption which may not be growing as fast. Also be wary of very early or niche frameworks which may not ever gain wide adoption.
the one common thread between most (or almost all) frameworks gaining in popularity is that they're MVC frameworks and rely heavily on a solid understanding of REST. Learning those concepts in depth is a good idea.
before deciding to invest a lot of time in one framework, gain a basic understanding of several of them, so you can get a reasonable sense of what you like and don't about each-- and so if you end up applying for a job using a framework you haven't learned, at least you'll be able to talk intelligently about it.
If you focus on what you enjoy, you'll be more motivated to learn it. For example, personally I found Rails (regarless of employment opportunities) more interesting than Spring or Django, so I decided to focus on Rails first. Others may have different impressions-- follow your programmer instincts. That said, there are often few jobs using technologies you find fascinating, so try to strike the right balance: technology you like that many companies are actually hiring people to use!
once you answer the basic "what framework" question, there are many more questions lurking, including picking a javascript framework, validation framework, an ORM, etc. Don't worry too much about those choices yet-- when starting, just pick the default implementation for your framework. But as you get more advanced, the same argument about frameworks also hold for those other things-- e.g. it's useful to know a few ORMs.
Personally, I decided on this approach:
continue building stuff in what I knew best (ASP.NET) but transition all work to ASP.NET MVC, where I can better understand MVC and REST concepts which apply cross-platform
learn JQuery (again, platform neutral)
blow off the ORM choice alltogether for now-- too many other things to worry about
build a few projects in Rails, which is the framework I see used most in the newer SF-Bay-Area startups I've been looking at
learn the basics (e.g. read a book or two, try a few samples) about Python/Django, Java/Spring, and Groovy/Grails.
I've encountered real projects at cool, small companies using Django, Ruby on Rails and (eiuw!) even Zope. .NET is for teletubbies - I've only ever heard of it being used by big corporations that don't know better.
I would say that knowing two or three is better than knowing one that is widely used because you will gain a better understanding of how it works as a concept. For instance if you've only used Java, there is something probably missing in your understanding of OOP, because you're pigeon-holed into thinking about it in one way. If you already know Django though you Spring would probably be a good compliment to that.
i'd probably say ASP.NET MVC. I always see lots of .NET jobs around and this seems to be a solid framework which i think in fact powers all the stackoverflow family. As a PHP developer i must also make a mention of Zend Framework which is used by a number of big sites including bbc.co.uk and is now frequently mentioned in advertisements for PHP jobs.
I want to learn a framework that promotes good programming practices and is respected by the programming community. However, I also want a framework that I can use for a day job.
Sorry to be the bearer of bad news here, but those two desires tend to conflict. IMHO most business managers tend to go for (ugly) rapid development on top of CRMs or other higher-level 3rd party codebases. Building elegant websites from the ground up mostly happens in startups, or true web companies where the website is the sole product. There are not that many of those companies; and many of those that seem to fit are actually a mess on the inside, i.e. due to time pressure, messy legacy code and many other reasons you often don't get to write according to "good programming practices" anyway.
I agree with Kaleb Brasee that Java and .NET are the two main platforms when job availability is a priority.
Every job market is unique, so look at job openings in your area, or call a handful of recruiters and ask what they see a need for / could easily place you in a junior position for. What I'm seeing is that Microsoft Sharepoint is in demand, and a few other regional CMS'es are in demand (in Denmark I see Sitecore regularly).
I think ASP.NET MVC 2.0 together with MVC Areas and ASP.NET Dynamic Data will have a good story, a good solution, for many of those bosses who want rapid development. And I think the resulting code could be quite okay, or at least not bad compared to many of the "CMS beaten into something else" sites that exist. But this is a brand new thing for the .NET platform, and it will need to be sold to the decision makers first...
Bottom line: If you want job security first and foremost, then look at large CMS's like Sharepoint, and work on other technologies in your spare time. Optionally you could take a job at a startup / a web company later; but look before you leap.
Have you tried Spring MVC? Many companies do use Java for web-apps (or .NET) and web service based applications.
Since you mentioned Ruby on Rails, you might want to learn Ruby on Rails. It has got some good programming practices in it and a very well thought architecture. The Ruby community itself have also (in my personal opinion) created very innovative frameworks and highly favor testing and quality. You can see this by the innovative testing framework like Cucumber, webrat, shoulda, coulda, rspec, test/spec. Many startups also uses Rails as their platform, so it should be easier for you to get a job. You can start looking at Working With Rails and 37signals job board. So there is a good ecosystem inside Rails and Ruby community.
But the downside of Rails compare to Django is mainly there are too much magic (less explicit) and the docs is not as good as Django. If you want to get a Django job, try looking at several news site because Django grew up from a newspaper site so it is adopted alot in news based sites.
I would recommend ASP.NET MVC, Ruby on Rails, or Python/Django, they all seem to be popular and successful, and based on the MVC paradigm which is definitely the right tool for the job when it comes to the web.
.NET and Java are by far the 2 largest platforms used by employers, and hence the most in-demand when searching for a job. Java has a few popular frameworks, with JSF, Spring MVC and Struts all seeming to be about equal in demand. I don't use .NET, but from what I've seen, ASP.NET and ASP.NET MVC are the major ones.
I would say that most of the frameworks mentioned here promotes good practices. But that doesn't neccesarily mean that the companies using those frameworks are actually following those good practices! In fact most probably aren't. So don't expect too much.
You see, places like Stack Overflow, Hacker News etc. are a great way to connect with people who really care about their craft. Sadly this is a minority. There are millions of programmers in the world. Most of them suck. The code they write sucks. They don't care. They are not interested in improving their skills. They just want to learn the bare minimum required to collect their paycheck, go home, feed the dog, spend some time with the family, watch some TV, go too bed and do it all over again the next day.
Okay that was a bit harsh :) What I'm getting at is that you are probably better off asking this question to some of the managers at the companies where you would like to work. My guess is that most of them will answer .NET or Java. If you are up for a laugh ask them why they chose that particular technology over something else, and see how many buzzwords they throw at you ;)

Should I create a blog in rails or use something that already exists?

In my next rails project I'm going to need blogging functionality. I'm wondering whether anyone has any good suggestions, or should I just roll my own? (Probably not in 15 minutes)
I think the most important feature will be to display code samples elegantly.
How's your free time?
Five years, that's how long that little idea took. Plus 2 years of adding bells and whistles. And that, folks, is why I'm giving in and using a blog host. Because I have lots of ideas, lots of things to say and to explore, but only a few dozen years left at best. I can't afford to go chasing every 5-year idea that springs to mind. After due consideration of the crap web frameworks and crap blog packages out there, I decided that I don't want to spend my next 5 years implementing my vision for a decent self-publishing system. Someone else can do it.
http://steve-yegge.blogspot.com/2006/03/blog-or-get-off-pot.html
It's a classic build-versus-buy (or, in this case, download for free) decision isn't it?
Write up the feature set of what you are looking for.
Survey the offerings out there to see how close a fit you have.
For the one or two products that is the closest fit, evaluate whether or not it would be less effort to write your own solution or customize the offering to do what you need.
If all you need is a blog site, then this is a no-brainer. Use WordPress and that's it.
If there are other features for this app and blogging is just one of them, then consider writing an app around WordPress. It is just a PHP application using MySql after all.
If WordPress has features or does things that you don't want, then maybe you do need to roll your own.
If the most important feature for this site is that it is to be written in RoR, then roll your own or find a RoR based blogging app as WordPress is not written in RoR. I haven't really done the homework on this but I would imagine that getting PHP and RoR to share session state would be a time consuming hack.
Rolling your own blog is a great project (and quite fun too!), but for practical usage, using something pre-made is going to be more secure, have more cool features, etc. etc. Unless you're incredibly dedicated, you'll probably end up cutting corners and end up with something that isn't quite what you want.
Despite being a Rails guy myself, I'm a huge fan of Wordpress. If you're looking for Rails-based blog engines, I've had luck with Mephisto, although the documentation leaves something to be desired. Radiant CMS is another CMS/Blog system that might be worth looking at.
A lot of Ruby/Rails developers have actually gone the route of using static website/blog generators. This has a few advantages. First, the pages are static HTML with no dependency on a database. This means they can be served by your front-end Web server (Apache, Nginx, etc.) faster than if they were to go through Mongrel, Thin or Phusion Passenger. Secondly, the pages will be easier for search engines to index. Finally, and probably most importantly, you can easily version control your posts using Git (or your favorite SCM)
I switched my blog over to a static model after development on Mephisto seemed to stall. I am using Tom Preston-Werner's Jekyll and Disqus for the comments. Works great. Give it a try!
If you are just looking for a project, then building your own blog engine is a good start.
Personally, though I have been a full-time Rails developer for the past 3 years, I still use and recommend Wordpress for myself and others.
If the project is to write a blog, don't roll your own. There are plenty solutions out there that will solve this problem for you while you worry about pumping out great content.
You will end up spending to much time futzing with the little things that don't really matter.
Probably there are tons of those.
For example, Rastafari, or Enkiblog.
In my next rails project I'm going to
need blogging functionality. I'm
wondering whether anyone has any good
suggestions, or should I just role my
own? (Probably not in 15 minutes)
I wouldn't recommend rolling your own blog system. You should look into using Radiant CMS with a blog extension.
I think the most important feature will be to display code samples elegantly.
For this I can recommend looking into SyntaxHighlighter.
All depends on your goal:
If it is for learning purposes and it's for fun, code it from scratch. Also, try to add new functionality that you will not find in current blogging platforms. For example, make in a way that is easy for a developer to blog tutorials or screencasts.
If it's for a client or just to blog, use wordpress. You can have your site in ruby and then link to wordpress. Think about it, how many human hours are behind wordpress so for you to match that you will need to work full time on it for 8 years.
Wordpress will work out of the box and then periodically you can tweak it, depending on future needs.
I agree, for fun and learning, code from scratch. But consider coding something people really need and don't already have. Innovate.
There are so many excellent blog platforms out there, and some (like Wordpress) have active developer communities writing hundreds of useful and powerful plugins. And that includes some excellent support for code samples.
No need to reinvent the wheel.

Resources