Blog

The News

Blog

Willkommen in unserem Blog. Hier finden Sie zurzeit hauptsächlich Beiträge zu verschiedenen Technologien und Programmiersprachen. Teilweise bloggen wir auf Deutsch und dann wieder auf Englisch, je nachdem was gerade für ein Thema anfällt. Viel Spaß beim Lesen!

Easy Roles Gem

Easy Roles is a simple rails gem for basic role authorization with ruby on rails. You can install the gem and after that you have the possibility to use it with the "Serialize" or the "Bitmask" Method. The exact difference between this two methods are explained on github. You can find the source code and exact install instructions here: [LINK]

 

How to use it in some other way:

In one of my…

07.06.2012
Matthias Frick
Ruby on Rails
1 Kommentar
Weiterlesen

import old database in new schema with mysql and rails

In this tutorial I will show you how you could import an old database into a new schema with mysql and rails. I will explain the process with an example scenario.

Scenario

Imagine you have an old php project with an old database schema and you want to completely refactor this project. Firstly you want to use rails instead of php and create a new rails project with the standard rails conventions. Secondly you want…

21.03.2012
Matthias Frick
Ruby on Rails
6 Kommentare
Weiterlesen

Simple mysql search with rails and jquery.highlight

I re-designed my whole website a few month ago and now I added one more key feature - a search for my blog. My blog is not as big, as maybe others are, so I decided to create a normal mysql search. I shortly thought about integrating a solution with solr, like the sunspot_rails gem, but then I thought that is to much and I simple chose mysql. Btw Ryan Bates did a very nice railscasts about the sunspot…

16.03.2012
Matthias Frick
Ruby on Rails, JavaScript
1 Kommentar
Weiterlesen

rails and mongoid i18n model attributes

Today we had a little problem in translate model attributes in one of my recent projects. We use mongodb with the mongoid gem as orm in this project. We create the project with multilingualism and we use the normal i18n gem for that.

Now here is a little tip for fixing model attributes translations in the .yml-Files:

Instead of this:

  en:
    activerecord:
      models:
        user: "Showmaster"
      attributes:
        user:
          email: "E-Mail"

Just write…

14.03.2012
Matthias Frick
Ruby on Rails
6 Kommentare
Weiterlesen