similar to: best way to check session for nil

Displaying 20 results from an estimated 20000 matches similar to: "best way to check session for nil"

2006 May 23
2
additional fields in session DB table
I am using active record sessions and everything works fine. I am integrating it with phpbb however so i need some extra fields populated in the session table. In application.rb i put a before_filter to update the session table I have a model for the sessions $ more app/models/session.rb class Session < ActiveRecord::Base set_primary_key "session_id" set_table_name
2006 Jan 17
6
Rails Best Practices Page
Hey, I have been progressively learning more and more rails each day (from both a current project, reading the agile book, and this list). Does anybody think it would be beneficial to have kind of like a rails "Best Practices" page that lists some of the better ways of handling certain functions of rails (that are common in most apps) that are both more elegant, and efficient. For
2006 Jan 07
4
set date with date_select
when retreiving a date from a DATETIME field in a database, is there a way to set the date to the value of the DB in the view? It seems to always default to the current date... if I have a field called birthdate in the users table and i do @user = User.find(@params[:id]) in my view i have a <%= date_select ''birthdate'',''user'' %> but dont know how to
2006 Jan 12
5
file_column preview in multistage forms
i have a 2 step form which contains 1 file_column field. The second form is just "This is how your post will look" kind of form and the user can click Edit (to take them back to form1) or Submit. If the user clicks edit it takes them back to the first form with fields populated. I have it working with all text fields, I just dont know how to do this with file_column field (showing the
2006 Jan 13
2
file_column in session
is it possible to store a field of type file_column in the session? Rails crashes on me every time i try to do something like the following: @session[:newpost] = @params[:post] however if i assign each field of @params[:post[ except for @params[:post]["image"] i have no problems. Is there something that should be done to allow the file in the session? thanks adam
2006 Jan 27
6
Scaffolding to use has_many and belongs_to ?
What does everyone on this list think about enhancing scaffolding somehow so that a "has_many" relationship will automatically drop the <select> box into the view to reference the "belongs_to" part of the view? I think scaffolding is great but I am always adding the <select> boxes to reference the parent association. Do you think this would be useful? just a
2006 Jan 11
1
handling AR object in multistage forms
in a multi-stage form, what is the proper way for handling the passing of the object thru each step ? If i have a database called events, and my controller looks like step = @params[:step] || 1 if step == 1 @event = Event.new @event = @session[:event] if @session[:event] elsif step == 2 @event = Event.new @event = @params[:event] elsif step == 3 @event = Event.new @event =
2006 Jan 04
6
ajax in rails is a security violation
Does anybody have any issues with the AJAX code inside rails? Whenever i use any sites i have built, or even external sites (such as basecamphq) my internal security device blocks access to the Ajax piece with a 400 Bad Request ( i scoured the net for other ajax examples and no isses anywhere else). I think there is something in the AJAX code of rails that is not implemented correctly. Has
2006 May 29
14
Jabber Powered Rails Chatroom
For those who cant access IRC, or just looking for a quick browser based alternative, i started an open jabber powered webchat for rails. Hopefully this will be a nice alternative for people to go to ask questions, get some help, offer some help, etc. I hope the community enjoys it, just trying to give a little back for all the hard work. It can be accessed here http://jabber.dufftech.com
2006 Mar 09
4
cross domain cookies
Does anybody know how to access the domain of a cookie from inside rails? I am try to integrate phpbb forums into my site and one of the things phpbb does is store a cookie. The forums are at forums.domain.com and the site is www.domain.com so i needed to set the cookie domain in phpbb to just be ".domain.com" so both sites can access it. The trouble is when using cookies[] in rails,
2006 May 12
5
how long before deleting sessions ?
What is the recommended amount of time to keep sessions around in the database (i store them in a sessions table). IF you get 1 million requests per day you are going to get 1 million new session entries in the DB. This would need some serious cleaning so just wondering what a safe cleanup time would be. Also does anyone know how to prevent new sessions records from being created if session
2006 Jan 30
4
How to encode URLs?
How does one encode URLs in ROR? Thanks Frank --------------------------------- Bring words and photos together (easily) with PhotoMail - it''s free and works with Yahoo! Mail. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060130/60280869/attachment.html
2006 Apr 28
3
persistent cookies
hello, I am trying to implement a "remember be" box for logins, however I cant seem to get it to work. I have tried the following 2 methods but neither seem to work. When i check the expiry time in firefox it always says "end of session". What is the proper way to handle this so the session cookie "_session_id" doesnt expire for a year? I tried
2006 Jan 09
5
file_column content type
is there a way using the file_column plugin to enforce a certain content type based on regex (i.ie, /^image/) and/or filesize (150k) ? thanks adam
2006 Feb 14
5
integrating vbulletin
Has anyone successfully integrated (embedded) vbulletin into a rails app? I would be curious to see if/how this worked. RForum still seems quite beta so I am looking for something a little more tried and true. thanks adam
2005 Dec 27
6
avoid multiple render per action
Hello, I have a hash that contains categories, and each category ID is a hash of subcategories. What i want to do is dynamically load that hash, loop thru it, for each category , subcat run a query against the DB, and render a partial. The issue is i put the render:partial in a for loop but you can only render once per action. What is the best way to loop thru all my categories without a
2006 Jan 30
10
form_remote_tag and redirects
I would like to have a login box setup so that if incorrect info is submitted, the box "shakes" via Effect.Shake. If the correct information is submitted, I want to redirect to some other page. The only solution I''ve found is the following, which is pretty ugly, as it displays the javascript I''m invoking on the page prior to the redirect. Here is the code: The Form
2006 Apr 05
11
session error in rails 1.1
I keep getting this error in rails 1.1, does anybody know what it means? My site will be working fine, i do some more development, get a parse error, and then all of a sudden the page 404''s with the following error Session contains objects whose class definition isn''t available Remember to require the classes for all objects kept in the session. (Original exception:
2006 Jan 13
1
validating without saving
i am trying to validate without saving use the valid? method on my object. however i keep getting the following error (that i reproduced in console) "NoMethodError for field" Any ideas ? thanks adam Loading development environment. >> p = Post.new => #<Post:0x407b6050 @attributes={"created_on"=>nil, "subcat"=>1, "cat"=>nil,
2006 Jan 26
4
is Client.find(params[:id]) safe?
@client = Client.find(params[:id]) I use the above line in alot of scripts because it is shown this way in the Rails book. Is this safe. Does it use placeholders? Will it leave me open to an SQL injection attack? -- Posted via http://www.ruby-forum.com/.