Displaying 2 results from an estimated 2 matches for "mystuff_controller".
2009 Jul 12
11
get DB data to rhtml file
I am trying to get data out of a database to my rhtml file. The files
look like this:
Model
-------
mystuff.rb
class Mystuff < ActiveRecord::Base
set_table_name "mytable"
set_primary_key "id"
end
Controllers
--------------
mystuff_controller.rb
require ''Mystuff''
class MystuffController < ApplicationController
def read
@me = Mystuff.find( :all)
end
end
Index
----------
Index.html.erb
<h1>Mystuff#index</h1>
<p><%mystuff.each do |mr|%></p>
<h1>mr.m1</h1...
2006 Apr 28
4
Call for patterns...
Hi group,
I was wondering if anyone more experienced could help me to find a good
pattern for two things:
1. How to group controllers. Example:
We have an admin panel with:
user_managment_controller.rb
priv_managment_controller.rb
widget_controller.rb
User panel with:
mystuff_controller.rb
mytags_controller.rb
profile_controller.rb
And frontend with:
widget_controller.rb
etc...
How do I group those controllers? Should I put them in subdirectories?
Does rails support this automagically?
and
2. I have a model/table Widget with fields a,b,c,etc.
Lets say guest can edit fields a,b...