Displaying 20 results from an estimated 500 matches similar to: "what is print_r in rails"
2005 Dec 22
3
acts_as_stateless ?
Is there such a thing that I could use to store sessions in the DB
instead of in a cookie so that I can ensure users will be able to
access their session data even across several load balancers? We use
totally stateless machines here at work and I am worried about
deploying a rails app in production that uses a volitile session
stored on the machine.
Any help is great!
Happy Holidays,
Mark
--
2005 Dec 19
6
how to do security??
hey, i have maded some security in my website based on
http://www.chaconforcongress.com/accounts/login
Here they work with users, roles and persmission, and they check it like this,
user.has_permission(permission).
I have extended this to: users and groups with roles and permissions.
With permissions like "view records","edit records","delete records",...
def
2005 Dec 15
10
.rpdf ?
I haven''t delved into the wonderful world of PDF::Writer yet, nor have I
run across a need.. but I just had an idea I wanted to throw out there
how hard would it be to create a .rpdf template plugin for rails?
could be neat ;]
2005 Dec 15
3
How to delete a record
hey,
i my database i have users and groups, each user can get in different groups
my db structure:
table groups: id, name, basegroup, firm_id
table users: id, firstname, lastname, email
table groups_users: group_id, user_id
my relation is a many to many:
class Group < ActiveRecord::Base
has_and_belongs_to_many :users
end
class User < ActiveRecord::Base
has_and_belongs_to_many
2006 Jan 23
1
Help with hmabt relationships
hey,
I want to have this table structure with users and groups
A user can be in more than 1 group and a group has more than 1 user.
class User < ActiveRecord::Base
has_many_and_belongs_to :groups
end
class Group < ActiveRecord::Base
has_many_and_belongs_to :users
end
I was wondering if i can do this
for group in user.groups
...do stuff
end
-AND-
for user in group.users
...do stuff
end
2005 Dec 21
1
how to sort records??
hey,
ยต
i have these records in my database, in a many-to-many relationship
clients_users
1;66
2;66
3;66
5;66
6;66
7;66
8;66
14;66
15;66
16;66
17;66
18;66
19;66
20;66
21;66
22;66
clients
1;VME Complex Foster
2;VME Res. Canada
3;Twodecode
5;Index
6;Verleye bvba
7;Venus bvba
8;All Building Services nv
14;Vitro-Service sa
15;Vitro-Clean
16;Vecom nv
17;Ultra lean bvba
18;Solar Cleaning Services nv
2005 Dec 29
3
Post problem with select lists
hey,
i have this problem
how come i always get -1 for the select list??
rhtml
First, select a client.
<select id="client_id" name="client[id]" onChange="submit();" >
<%= options_for_select(@client_options, @client_id.to_i) %>
</select><%= @client_id %>
controller
if @request.post?
if @request.xml_http_request? #called by ajax,
2005 Dec 21
4
[OT] server partitioning question (rails + postgres)
Hi,
A bit off-topic, but I''m about to set up a remote Linux server
for Rails, with postgres and probably Lighttpd.
The server has two 120GB hard drives, one of which will just be
for nightly backups of the other.
I don''t intend to have any untrusted user accounts on the server.
The server will be dedicated to my own applications.
I''ll want to support lots of www
2006 May 31
3
Print out session dump?
How can I go about printing out an object in Ruby? I''m looking for the
print_r php equivalent. All I''m trying to do is print out session
information. It is exactly what is shown in "Show session dump" when an
exception is caught. Any ideas? Thanks.
--
View this message in context: http://www.nabble.com/Print+out+session+dump--t1712872.html#a4651059
Sent from the
2005 Dec 23
8
webrick / winxp won''t stop serving cached file??
Hi
Working through the tut material in teh PP book (agile dev with rails)
on a laptop running winxp.
Creating the "admin" application, things generally work great. Except:
at teh end of chapter 6, when we update teh css to improve the look of
the page - I copy the new scaffold.css into my working directory, but
webrick keeps serving the old css, even after a restart. Very odd. The
2005 Oct 28
5
What is Ming
Mentioned by Amy Hoy in the recent ROR podcast. I googled but didn''t
find anything.
Thanks
Ed
2006 Jun 12
1
debugging
Hello-
If I am in the middle of a method in an ActiveRecord object or a
controller how can I just print something out to the screen and either
keep going or exit immediately?
If I am in a controller I can just generate some text and:
render :text => "my debug output"
But it would be nice to print something out to the output buffer and
then continue on. Additionally, if I am inside
2007 Jul 17
1
Prototype: 2 questions (elements' attributes, dumping methods)
hello again)
1) i just wanted to know is it possible to get element''s attributes in
hash or array?
for example something like this:
<span style="color:red;" id="myEl" onclick="alert(1)">
..
$(''myEl'').attibutes().length // == 3
2) is there any analogues of php functions var_dump() and print_r()
for Objects/Hashes and Arrays?
thank
2005 Dec 19
7
How about a forked session supervisor in dispatch.fcgi?
I was talking to a friend of mine who''s developing PHP on trax and we
came up with a solution to the ruby session file problem. I''m not
sure if this idea has come up before, so I wanted to run it by
everyone before making any code contributations and/or talking to the
Rails core about it.
It seems to me that the current situation we''re in with regard to
2006 Jul 05
8
loginGenerator - getting logged in username
i am working on a site taht uses loginGenerator..
it''s a great little package, but i am running into one little problem..
i would like to have something that says:
"logged in as <username>" in the site, but i am not quite getting it..
what i am using is:
<p>You are logged in as: <%= @session[:user] %>
but i have tried:
<p>You are logged in as:
2011 Oct 28
0
libvirt-php - API libvirt_domain_suspend() problem, doesn't work
Hi Guys,
I was trying to suspend a virtual machine but fail not sure why.... However
i was successfully list all the vm on the host, below are my source code,
can any one who have experience in this area give me some advised ?
*My OUTPUT from browser*
Array
(
[libvirt.release] => 3
[libvirt.minor] => 9
[libvirt.major] => 0
[connector.version] => 0.4.3
2014 Mar 24
0
metadata 2
you could set up a php yp-server and add a line in the icecast config
$email = "you at somewhere";
if($_REQUEST['action'] == "remove"){
header("YPResponse: 1");
header("YPMessage: Deleted server info.");
mail($email,'YP debug: remove stream',print_r($_REQUEST,true));
}
if($_REQUEST['action'] ==
2014 Mar 23
6
metadata 2
Hoi folks,
I don't like to post in newsletter because of several reason but sometimes it
isn't evitable.
I am setting up a internet-radio-show (exclusively live, including 2 video-streams)
and I want to read out the audio-metadata of momentarily played tracks in realtime
to compare it against a SQL-database.
The aim is to fill up and/or update a table with 'most played'
2006 Jan 05
7
Multilanguage problem, need help
hey,
i use http://mir.aculo.us/articles/2005/10/03/ruby-on-rails-i18n-revisited
then i have nl_BE.rb, de_DE.rb, en_US.rb as translation files.
this works all fine when i have normal characters, but i have one problem
when i have wierd characters like ? ? ? (mostly in french), then i get japanese
charachters on my site
i use utf8 for my database and i set this for each def in my controllers,
2005 Oct 17
4
How to send excel file to browser (spreadsheat 0.3.2)
hey, i want to generate an excel file and send it directly to the browser
(without storing it to the harddisk).
does anyone has any solution?
thanks in advance
this is my code:
--------------------
def export_excel
if @request.env[''HTTP_USER_AGENT''] =~ /msie/i
@headers[''Pragma''] = ''''
@headers[''Cache-Control''] =