“new” actions in nested rails resources
October 28th, 2007 • Uncategorized
def new @my_model = MyModel.new end # vs. def new @my_model = @my_parent_model.my_models.build # gives you access to parent properties # (useful e.g. in views) end
October 28th, 2007 • Uncategorized
def new @my_model = MyModel.new end # vs. def new @my_model = @my_parent_model.my_models.build # gives you access to parent properties # (useful e.g. in views) end