Displaying 20 results from an estimated 50000 matches similar to: "model questions about using ?"
2006 Apr 13
7
Whats the best way to achieve this?
employees HABTM projects, projects HABTM employees.
I am doing a permissions page for a selected project. I know that I can
get all of the employees in the system (@employee.find(:all)) or get all
the employees for the selected project.
What i''m trying to do is get a list of all the employees in the system
and have a check box that states if they are associated with the
current
2006 Mar 28
2
In_place_editor_field throws error ...
I receive the following error:
Called id for nil, which would mistakenly be 4 -- if you really wanted
the id of nil, use object_id
when trying to use the in_place_editor_field tag:
<% for employee in @employees %>
<%= in_place_editor_field :employee, employee.fname %>
<% end %>
My model is called Employee and is being populated from a controller
method employees_list:
2006 Jan 27
2
DB & AR advise please (diagram inc)
Hi,
Being new to Rails and Active record could someone please check my
database diagram:
http://spectrais.com//images/0.png
I am building a trouble ticket system for my company. Simply put a
client has many users. Those users can create trouble tickets. Each
trouble ticket can have many journals that track the progress of the
ticket. An employee (of our company) can take ownership of a
2006 Feb 20
6
LoginGenerator - multiple user types...
I have been looking at the LoginGenerator gem. Looks great and can be
easily modified. However in my app I have two places where people can
login, one is for in my case "employees" the other is for "users". They
are seperate tables in my database and have many different fields.
I have an admin area located at ./sysadmin/ where only "employees" can
login, they
2006 Mar 29
3
partial variable help
Can''t work this out:
In list.rhtml:
<% for employee in @employees -%>
<%= render(:partial => "list_form", :object => employee) %>
<% end -%>
In _list_form.rhtml (partial):
<%= employee.id %>
In controller:
@employees = Employee.find(:all)
I get the following error:
undefined local variable or method `employee''
I everything is correct
2006 Mar 27
9
rename app>controller subfolder crashes app
Help,
I changed a folder name in my app>controller from admin to company and
now I get a company is not a class error.
I do not have any custom routes set and have changed all references to
admin, no joy.
Does ruby / rails have a cache of the names?
--
Posted via http://www.ruby-forum.com/.
2001 Dec 10
3
Help! Accounts unable to log
Hi everybody,
I dont understand whats going on with my samba server, I have set up 15
identical accounts (with different login/passwd), added all of them via
the smbpasswd and everything, checked the passwords file and all of them
seem to have a password, and oddly enough there are 4 accounts that are
not working!, when I try to log using Win 95 I receive a message saying
that either my
2006 Feb 21
11
helper for models?
Is there such a thing?
I have some duplicate methods in my models, can I place them somewhere
and call them in to my models, thus keeping DRY?
--
Posted via http://www.ruby-forum.com/.
2006 Apr 03
7
Javascript helpers not updating table row in IE6
Trying to replace a table row with an id using both RJS templates and
normal link_to_remote :update. Neither work in IE6, fine in FF etc.
If I use the same code but target a div with an ID it works. This is
tricky as I have a table with edit buttons, when the button is pressed
that row gets updated with a partial containing a form for update. I
need this to work as II don''t fancy
2006 Apr 27
6
How to trim a string?
This must be really simple but I have looked everywhere.
I have a <%= item.description -% in my view and I want to trim it to 10
words.
The description can be long and I want to trim this in my preview?
--
Posted via http://www.ruby-forum.com/.
2006 Feb 08
3
ungenerate / remove scaffold command?
I have seen this somewhere and can''t find it now. Is there an ungenerate
or remove command for the scaffold generator. It would be easier than
removing all the files by hand.
I have tried ./script/ungenerate but no luck.
Thanks
--
Posted via http://www.ruby-forum.com/.
2006 Feb 19
3
accounts and subdomains
With reference to a previous
post:http://www.ruby-forum.com/topic/55201#new
I would like my app to function as follows:
A new user signs up for my application, his username is "andy". When
andy now logs in to the application the url is redirected to :
http://andy.myapplication.com
Questions:
Is this possible to develop on a windows box with webrick?
Do I need anything special like
2006 Apr 06
2
rails 1.1 - console broken
Have upgraded to rails 1.1 and now ruby script/console does not work.
Throws an error:
c:\work\development\rails\application1>ruby script/console
Loading development environment.
c:/tools/ruby/lib/ruby/1.8/irb/init.rb:151:in `parse_opts'': undefined
method `up
case'' for nil:NilClass (NoMethodError)
from c:/tools/ruby/lib/ruby/1.8/irb/init.rb:19:in `setup''
2011 Jan 21
6
help writing types/provider
I''ve almost finished a pretty simple type/provider to manage
RabbitMQ users and virtual hosts.
I''m using the ''ensurable'' keyword in my type to save a bit of boilerplate.
Type is below (the provider is just a wrapper around the ''rabbitmqctl''
command.
Have a feeling there''s a developer guide somewhere I haven''t found
(been
2006 Aug 16
2
accessing a model from a migration
Hello again!
ok, i have some initial migration code which sets up my apps schema. i have a
few tables that get initialized with data in this migration where i have the
table data in yaml format in test/fixtures. i use db:fixtures:load
FIXTURES=countries,provstates,employees to initialize these tables..
here''s the wrinkle: employees when it gets loaded should only contain the admin
2006 Mar 27
2
Form Validation with 2 models on form. Nubee Question
I have one form in which i enter Person data and Employee Data. A Person
and Employee model are used. I am using a legacy schema, so this is
forced.
How do i use save the data while using rails form validation?? I only
want both models to save if they both save.
Controller :
This odviously doesnt work:
def create_employee_and_person
employee = Employee.new(params[:employee])
person =
2005 Jul 11
4
wonder-shaper
Hi all,
I need to provide shell hosting for about 40 users, and few
days ago I found the wondershaper script, so Im trying to
know if this script could help me to improve interactive ssh/telnet
connections.
Wondershaper could help me or its only efective on OUTGOINGS requests?
Ok, any comment and feedback will be welcome.
Sorry for my bad english and THANKS in advance.
2005 Mar 08
1
To convert an adjacency list model into a nested set model
Dear R-help
I am wondering if somebody wrote some code to convert an adjacency list
model into a nested set model.
In principal I want to do the same as John Celko mentioned it here with
SQL:
http://groups.google.co.uk/groups?hl=en&lr=lang_en&selm=8j0n05%24n31%241
%40nnrp1.deja.com
Assume you have a tree structure like this
Albert
/ \
/
2018 Aug 02
3
Default compression level for -compress-debug-info=zlib?
Not really, as well as some sensitivity to the input data overall
performance of the link with compression will depend on how this is
implemented in lld - how is it parallelized? How is it chunked? Is it
effectively pipelined with IO?
Or, I wouldn't feel comfortable being able to make a recommendation to our
end-users on whether to use this option or not based on my existing
extensive
2006 Mar 24
7
Polymorphic associations?
I''ve read the stuff about polymorphic associations here:
http://wiki.rubyonrails.org/rails/pages/UnderstandingPolymorphicAssociations
But I''m not sure what exactly they are and what their advantage is. Are
they the same as HABTM, but they''re "two-way"?
Joe
--
Posted via http://www.ruby-forum.com/.