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!

use view helper methods in controllers in rails 3

Sometimes it is comfortable to use view helpers in controller methods to customize things like pluralisation, links, mailto´s, etc . Rails provides a lot of view helpers, which can be used in controllers or normal helpers. In Rails 3 it is possible to call view_context inside a controller. This call will create a new ActionView instance for a controller, then all view helper methods will be available through this instance and you can simple do stuff like this:

03.08.2012
Matthias Frick
Ruby on Rails
0 Kommentare
Weiterlesen

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