Displaying 20 results from an estimated 500 matches similar to: "HABTM - two lists"
2006 Sep 07
2
Feasibility question: get samba to back-up every version of a file
Hi everyone,
How feasible would it be to get samba to back-up every version of a file
that the Windows user saves? Specifically:
1) can you trap the "file saved" event somehow in a meaninful way?
2) is it possible to distinguish something like Access MDB access - ie,
continual updates of some sort - from a regular file save?
3) what sort of level of knowledge of Samba, C/C++,
2006 Apr 11
6
Reduce Number of Queries When Using ActiveRecord
I have a controller method called update_all that grabs parameters for about
30 form fields and saves them to the database. My current code looks to see
if there is a string in params[] for each form field (two fields for each
SelfEvaluationItem) and saves the updated self_evaluation_answer if a string
is available. Since this is iterated code, I am almost certain that this
generates 30 or so
2012 Oct 21
5
Error occured while evaluating nil
This is the code
if !params[:ratings].nil?
params[:ratings].each_key do |r|
@selected_ratings << r
@movies << Movie.where(''rating = :rating'', :rating => r)
@sort = params[:sort]
end
elsif
@selected_ratings = @all_ratings
@movies = Movie.order(@sort)
@sort = params[:sort]
end
This is the error
You have a nil object
2012 Oct 21
2
check box tag binding between controller and the view
I am new to RoR. The problem i am facing is that that i have a few check
box and initially when i run my app for the first time i want them all
to be selected while for every next time i want it to have the last
checked boxes checked. To do this, In my controller i have
@all_ratings = Movie.all_ratings
@selected_ratings = []
if !params[:ratings].nil?
2006 Jun 16
1
Is there a way of retrieving all req parameters without name
Is there a way of retrieving all the request parameters without name in
the controller.
Thanks & Regards,
Asem
--
Posted via http://www.ruby-forum.com/.
2006 Feb 12
6
Including another helper
I need to include another helper module apart from the normal two
(ApplicationHelper and [controllername]Helper). The inclusion needs to
be dynamic and based on external parameters (ie what helper that get
included differ from request to request).
Is it possible? How?
/Marcus
2006 Jun 26
7
Using Rails to Generate static pages
Hi all,
Has anyone ever thought about or implemented a way to use Rails to pull
content from a database and actually *generate* static html pages from view
templates?
I want to throw a bunch of content into a db using rails and then put all
my website templates into the views dir and write the files out with the
content inside.
The funny thing is that the html pages Rails normally outputs to
2006 Mar 03
3
dynamic queries
Is there an easy (and secure) way to search your database when you don''t
know the number of parameters ahead of time? I can see doing it by
concatenating together an sql query, but hopefully rails provides a more
elegant way to do this with ActiveRecord without making a ginormous switch
statement?
For example, lets say my search form has 4 different input boxes. I only
want the query
2006 Apr 08
7
text_field and arrays
Hi,
I''m trying to do a bulk update on an array with the helper text_field.
I''m trying to create an inputfield for every object in the array, but
I''m not getting it right...
example:
class ClassA
@arrayB[]
end
HTML (code with error):
<% 0.upto(9) do |index| %>
<%= text_field ''ClassA'', ''arrayB[index]'' %>
non
2009 Nov 26
9
ActionView::TemplateError (can't convert ActiveRecord::Error into String)
I cannot work out why this error is appearing.
ActionView::TemplateError (can''t convert ActiveRecord::Error into
String) on line #3 of app/views/button/_show_enquiry.html.erb:
1: <h1>Send us a message</h1>
2: <% remote_form_for :enquiry, :url => {:action => ''send_mail''} do |
f| %>
3: <%= error_messages_for ''enquiry'',
2006 Jun 04
4
Multiple checkboxes
Please could someone suggest what might be wrong here. In my view I''m
displaying a series of check boxes and when the form is submitted I want
the controller to iterate over the values and contatenate them all into
a string "1" if the box was checked and "0" if it wasn''t.
I''m new to Ruby and Rails and I can''t seem to get any values out of
2007 Apr 10
8
ferret-0.11.4-mswin32 not compatible with Ruby1.8.4
Just a quick note for future reference - at least for me, ferret won''t
work on Ruby 1.8.4.
gem install ferret
Successfully installed ferret-0.11.4-mswin32
ruby -v
ruby 1.8.4 (2005-12-24) [i386-mswin32]
irb
irb(main):001:0> require ''ferret''
A windows error message box appears -
ruby.exe - Entry Point Not Found
The procedure entry point rb_w32_write could not be
2016 Jul 12
2
Enforcing password history policy on password resets
Hi there,
We are using Samba as a user directory for our application. Passwords are
stored in unicodePwd attribute, and our application resets passwords
through LDAP (without the knowledge of the previous password, because it's
an email-based reset).
Unfortunately resetting it like this prevents the "password history" policy
enforcement. This is a security problem that will come up
2006 Jul 26
13
tweaking minimum word length?
Hi,
Can Ferret be configured to change the minimum word length of what it
indexes? Right now it seems to drop words 3 characters or less, but
I''d like to include words going down to 2 characters. How would I do
that?
Francis
2006 May 31
6
habtm on an array (or object.habtm.habtm)
Hi,
I have three Models: User, Group and File.
User habtm groups
and
Group habtm Files
How can I find all files that a particular user has access to?
eg user.groups.files ?
As user.groups returns an array, the above doesn''t work.
Id like to find the files for all groups in that array, without adding
any code to the User model.
Thanks in advance
PS I just posted this in the
2009 Oct 12
2
yaml ?nodes? or nested maps
I want to iterate ?nodes? and ?leafs? for a yaml document:
thufir@ARRAKIS:~/projects/rss$
thufir@ARRAKIS:~/projects/rss$ ruby user.rb
user.rb:6: undefined method `[]'' for nil:NilClass (NoMethodError)
from user.rb:5:in `each_key''
from user.rb:5
thufir@ARRAKIS:~/projects/rss$
thufir@ARRAKIS:~/projects/rss$ ruby user2.rb
user2.rb:5: undefined method `[]'' for
2006 Mar 12
0
NameError when trying to combine Recipe 14 (rich HABTM) & Rec. 10 (self-ref HABTM):
Hi all,
I''m trying to model self-referential relations between people, where the
relation has attached data.
John ''works for'' Bob
Problem: '':through'' doesn''t work, and generates a NameError.
=> the models :
Person (attr: name)
Relation (attr: source_id, target_id)
(more details below)
ex: John ''works
2006 Mar 13
3
HABTM: two habtm''s between the same two tables
Imagine I want to track people, and the clubs that they belong to.
table people with columns person_id, person_name
table clubs with columns club_id, club_name
And I have the association table:
table clubs_people with columns person_id, club_id
Now I know how to do this habtm between the two, in order to associate
people with clubs that they belong to.
However my application also needs a
2007 Mar 01
2
FerretHash
Dave, thank you so much for the 0.11 release(s). You have solved many
problems for me. As part of my appreciation for your good works, I am
offering up for public consideration a silly little class that I wrote.
(Code is below.) This class offers a simplified Hash-like interface to
(a very restricted subset of) Ferret. Hence I call it FerretHash.
FerretHash comes with its very own pet Ferret
2006 Nov 04
0
Model.delete_all vs Model.destroy_all in a habtm
Hi there
I have an habtm association between 2 Models.
I regularly have to truncate the table on one side of the relationship
and repopulate the table with a fresh csv file.
I notice that f I do Model.delete_all, none of the records in my habtm
join table get deleted, whereas if I use destroy_all they do.
However, the overhead of using destroy_all is too great. For the
amount of records I have