Creating new object

A newbie question here :
I don t get how to create a new object without using the magical
line : @your_object =[:object])

I have a grid with a size, I would like to create the case associate
to the grid at the creatin on the grid, I have try the following in
the grid controller:

def create
((@grid.taille)-1).times do |i| //don t pay
attention to the loop, and the attribution of corrdinate, it s not a
square grid
((@grid.taille)-1).times do |j|
@case =[:case])
@case.x = i
@case.y = -j
@case.grid_id =
flash[:notice] = ‘Case’ + i +’ ‘+ j + ’ was successfully


But it return an error : “wrong number of arguments (0 for 1)”
Hope you can help me.

      @case.y = -j

Probably here should be number with ‘+’. Try to take this ‘-’ before ‘j’

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs