Displaying 20 results from an estimated 8000 matches similar to: "Showing a neat error message"
2006 Mar 13
6
:dependent => :destroy
Hi,
There is something I don''t understand about :dependent => :destroy. I
hope someone can help me. Consider this code:
class Folder < ActiveRecord::Base
has_many :myfiles
has_many :folders
has_many :group_folders, :dependent => :destroy
validates_uniqueness_of :name, :scope => "folder_id"
validates_presence_of :name
before_destroy
2006 Jan 11
3
Just update 1 field
Hi All,
I wonder how I can get rails to update just one field when I do Myfile.save.
Right now this happens when I do a Myfile.save:
UPDATE myfiles SET `folder_id` = 0, `filesize` = 1, `data` =
''2f7573722f6c6f63616c2f6d ... f7061636b65743d33324d'', `user_id` = 0,
`date_modified` = ''2006-01-11T23:33:57+0100'', `filename` =
''mysqlscripts.sql''
2006 May 18
3
access to an ApplicationController property from a view
Hi there,
How is it possible to get access to an ApplicationController property
from a view?
Consider this (simplified) situation:
class ApplicationController < ActionController::Base
def folder_id
@folder_id = params[:id]
return @folder_id
end
end
class FolderController < ApplicationController
def show
@folder = Folder.find_by_id(folder_id)
end
end
So far,
2007 Feb 28
5
How to use find_options in multi_search
Hello everyone,
I''m using multi-search to search in some attributes of two classes. One
of the attributes is the id of the customer. For each multi_search I
want to do a give the id of the current customer as a parameter. This
should only return results for the given customer.
My current code looks like this:
Folder.multi_search(@search_query, [Myfile])
I noticed in the API you can
2006 Jun 23
10
Don''t un-admin the last administrator
I have a User class with a field called admin which is a boolean that
determines if the user is or is not an administrator. I want to make it
impossible for the last administrator for an account to be removed from
the system.
I need to protect against this both when deleting a user and when
editing a user as you can revoke a user''s administrator privileges via a
form.
User
2005 Mar 08
3
Configuring WEBBrick for Port 80
I''ve looked everywhere [except the right place], but I can''t find where
to change WEBbrick from listening to port 3000 to port 80.
Can anyone point me in the right direction.
Thanks
Neville
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails
2005 Mar 03
5
Whats ''favicon.ico''
I''m seeing the following in the WEBbrick console output after every GET
192.168.0.108 - - [03/Mar/2005:15:35:19 AUS Eastern Daylight Time] "GET
/favicon.ico HTTP/1.1" 200 60
- -> /favicon.ico
What does /favicon.ico (which doesnt seem to exist in my source) do for
Rails?
_______________________________________________
Rails mailing list
2005 Mar 09
10
Confused about extending the login generator ''user''
I''ve been using the login generator ''out of the box'' for simple
authentication, and its been working fine.
Now I want to extend it by simply adding ''type_id'' field which links to
my ''user_types'' table, but I''m hitting:
#<ActionController::SessionRestoreError: Session contained objects where
the class definition
2007 Feb 06
2
Which method to use to get content from index with a_a_f?
Hi everybody,
After staring at the a_a_f API for quite sometime now, I decided it''s
time to ask...
Which method should I use to get content from the index without using
highlight? Consider the following controller action:
def preview
if params[:search].blank? # normal case
@text = @myfile. # which method do I use here to get the :text from
the index???
else # if we come from
2005 Mar 02
4
All I want for Christmas
is to run my Rails app on lighttpd ....
Unfortunately, I am tied to SQL Server, and the database connector
requires ADO.rb which only runs on Win32.
And lighttpd doesnt run on Win32.
*sigh*
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails
2005 Nov 23
8
Compiler OR Obfuscator for RoR applications?
Hi folks,
I''m a newbie in the Ruby land, The Ruby language and RoR looks really
great but I think in my situation there is a problem, we are an ISV
that sells web application and we don''t want our clients see our
source code, I searched the web but couldn''t find any way to compile
and\or obfuscate ruby code (in web (RoR)), is there such tool
available for the language?
2005 Mar 05
9
Best practice to manage ''id'' hacking?
In my app, a user logs in [via the login generator] and has access to
details of his account, and transactions attached to his account.
This is achieved in the standard rail manner by passing the account id
or transaction id between the controller and the view.
But what is to stop someone hacking the URL or view html to access
another account id or transaction id ?
eg /account/show/46 becomes
2005 Mar 03
19
Better tools for authoring the view
I''m hand editing my .css and .rhtml files using SciTE and hitting
refresh in my browser to see the results - its slow going.
What tools are people using to author their .css and .rhtml files?
Thanks,
Neville
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
2005 Oct 06
5
webrick seen only on local machine
I am running the webrick server (/script/server) and I would like to be
able to view the application from any browser. However, I can only see
my application from a browser opened up on the localhost. When I use
any other browser it times out. I have already modified the following
line in the /script/server file (I''ve tried the numeric ip address also)
so that it is the real ip
2005 Oct 06
8
accessing extra request parameters
hi all,
how are other people passing and accessing ''get'' parameters from their apps?
what is the best way to do it?
ie:
www.example.com/controller/action/id/extra/extra2/ ??
or
www.example.com/controller/action/id/~extra/extra2/
or what ever....
are there built in methods for passing and accessing extra parameters?
thanks for your suggestions
-felix
2008 Apr 18
3
Relating to records in same table
I''m in progress of making a little folder system with Ruby on Rails.
I''ve got a "folders" table. Each "folder" has got an id and a folder_id.
The folder_id is supposed to represent the folders'' parent folder.
How can I tell Rails?
I would like Rails to automaticly delete all subfolders of a folder when
I delete the folder it self.
Any ideas?
--
2005 Dec 27
2
ruby 1.8.2 or 1.8.3 on Linux?
I''ve seen some reports of problems with running Rails (version 1.0
here) on Ruby 1.8.3. Is this true across the board or just Mac OS?
I''m setting up a Linux server and want to know if 1.8.3 is ok on that.
Thanks,
Jamie
2005 Mar 05
4
''Session id'' hacking?
> Because you mentioned "cookie-hacking": it is very easy to
> take over a rails-session if you know the value of the
> session-cookie. It is not possible to prevent that easily,
> you can just make it harder by encrypting the whole session
> (right from the beginning when the user enters the site,
> and the cookie is created) by using https.
https will encrypted
2006 Sep 22
3
Error with :create => true and existing index
I implemented a "reindex" command which simply creates an IndexWriter
with :create => true for a prexisting index.
The "reindexing" seems to start out ok, with several thousand docs
added, then Ferret throws an exception:
IO Error occured: couldn''t rename file "index\_0.tmp" to "index\_0.cfs":
<File exists>
I guess that _0.cfs is held
2006 May 16
2
Validate Before Delete
I have an Order model with a ''status'' column. What I want to be able to do
is validate that the status of the Order is not completed before it is
allowed to be deleted. I tried the following method in my Model, but it
appears that this only works for an :update or :create on the record.
Anyone know how to do this, and if it should be in the model or the
controller?