Solid Tutorial for Building a Simple Wiki Application in Ruby on Rails

Solid tutorial for building a simple wiki application in Ruby on Rails?

You can easily create a wiki with zena (a rails CMS):

  1. You create an empty application with

    zena wiki

  2. You initialize an empty database

    cd wiki; rake zena:init RAILS_ENV=production

  3. You set the publish, write and read groups of a node to "public" (use the wrench tool, "drive" tab)

  4. You change the anonymous user's status from "moderated" to "user" (user management by clicking on the "Admin User" link)

And you have a wiki with multilingual support (if you need it) and the usual versioning, diff tools and image management.

Wiki software that runs wiki.rubyonrails.org available for download?

From the meta generator tag in the source of any page on http://wiki.rubyonrails.org/ it appears to be DokuWiki

Wiki software that runs wiki.rubyonrails.org available for download?

From the meta generator tag in the source of any page on http://wiki.rubyonrails.org/ it appears to be DokuWiki

Learning Ruby on Rails

I've been moving from C# in my professional career to looking at Ruby and RoR in my personal life, and I've found linux to be slightly more appealing personally for development. Particularly now that I've started using git, the implementation is cleaner on linux.

Currently I'm dual booting and getting closer to running Ubuntu full time. I'm using gedit with various plugins for the development environment. And as of late 2010, I'm making the push to use Vim for development, even over Textmate on OS X.

A large amount of the Rails developers are using (gasp) Macs, which has actually got me thinking in that direction.

Although I haven't tried it, Ruby in Steel gives you a Ruby IDE inside the Visual Studio world, and IronRuby is the .NET flavor of Ruby, if you're interested.

As far as books are concerned, the Programming Ruby (also known as the Pickaxe) book from the Pragmatic Programmers is the de-facto for learning Ruby. I bit the bullet and purchased that book and Agile Web Development with Rails; both books have been excellent.

Peepcode screencasts and PDF books have also been great for getting started; at $9 per screencast it's hard to go wrong. I actually bought a 5-pack.

Also check out the following:

  • Official Rails Guides
  • Railscasts
  • railsapi.com or Ruby on Rails - APIdock
  • The Ruby Show
  • Rails for Zombies
  • Softies on Rails - Ruby on Rails for .NET Developers
  • Rails Podcast
  • Rails Best Practices

I've burned through the backlog of Rails and Rails Envy podcasts in the past month and they have provided wonderful insight into lots of topics, even regarding software development in general.

Can anyone advice good materials for studying Ruby (starting from the very beginning)?

Tryruby - fun and simple

Intoducing ruby - ruby courses from Codecademy

first steps using ruby-vips

(note This was a very old answer and described ruby-vips as of two major versions ago. I've updated it for the 2.0.16 gem, the current version in November 2019)

There is complete documentation here:

https://rubydoc.info/gems/ruby-vips

The Vips section has a tutorial-style introduction:

https://rubydoc.info/gems/ruby-vips/Vips

For example:

require 'vips'

if ARGV.length < 2
raise "usage: #{$PROGRAM_NAME}: input-file output-file"
end

im = Vips::Image.new_from_file ARGV[0], access: :sequential

im *= [1, 2, 1]

mask = Vips::Image.new_from_array [
[-1, -1, -1],
[-1, 16, -1],
[-1, -1, -1]
], 8
im = im.conv mask, precision: :integer

im.write_to_file ARGV[1]

This opens an image in streaming mode, multiplies the middle band (green) by two, sharpens the image with an integer convolution, and writes the result back. You can run it like this:

./example.rb x.jpg y.ppm

There's a full "daltonize" example in the ruby-vips repo:

https://github.com/libvips/ruby-vips/blob/master/example/daltonize8.rb

How can I set a default image for user in Rails

you can use before_create in your model, to set the default image.

before_create :set_default_avatar

def set_default_avatar
# your code
end

and here other discussion regarding about your question, Rails - What is the best way to display default avatar if user doesn't have one?



Related Topics



Leave a reply



Submit