similar to: session usage

Displaying 20 results from an estimated 20000 matches similar to: "session usage"

2006 Feb 08
7
DRY methodology
because I am a grasshopper... Now that I can sort my ''list''...is there a logical way of not repeating myself to having essentially the same list view with multiple sorts? i.e. def list_cl # ordered by clients last name @placement_pages, @placements = paginate( :placements, :include => [:client], :order_by =>
2006 Apr 28
3
store user id in session or find user id
Hi Im uisng the lgoin generatior that as far as I can tell stores the username in session. I have another table that i need to store the id of the user who creates an entry. (the logged in user) Is it possible to store return the id and store it in session once the user is created. then do somthing like @project.user_id = session[:user].id; or can I perform a search in the product table
2006 Feb 06
3
linked table confusion
placement.rb has_one :client has_one :case_manager client.rb belongs_to :case_manager has_many :placements case_manager.rb has_many :clients has_many :placements I am trying to create a view file for placements. I can pull columns from clients table in this view by using... <%= @placement.client.wholename %> but if I use <% @placement.case_manager.wholename %>
2006 Feb 26
5
Plugins? Components?
Hi, Newbie here :) Can someone help explain the difference between "plugins" (put in the /vendor/plugins directory) and "components" (put into the /components directory)? Is it just that "plugins" have an init.rb file that is automatically loaded? Also, how can I dynamically find out which files/controllers are available in the /components directory? Thanks,
2006 Feb 13
9
Please e-mail (not only post) the Forum Instructions URL
Am I just blind, or are there no links to the instructions, e.g. the Search syntax or how to get back to a thread I started on RoR? Or do those links, buttons, whatever only show / work in IE? Thanks for any help; sorry if I can''t figure out something I should be able to. jandjharris (at) gmail.com -- Posted via http://www.ruby-forum.com/.
2006 Apr 02
5
Showing current user''s information and saving
Hi, I am logging users in and keeping them in session. The problem I am having is showing only a certain logged in user''s information. In the Adverts_Controler: def show @advert = Advert.find(params[:id]) end I am also having issues with saving an advert for an user: def create @advert = Advert.new(params[:advert]) if @advert.save flash[:notice] = ''Advert
2006 Mar 30
5
Has_many :through problems -- please help
I''m having a lot of trouble with has_many, :through and could really use some assistance. I''ve got a User and Group class. Users can subscribe to groups, and groups should know who''s subscribed. I''ve got a join table (group_subscriptions) with group_id, user_id, and it''s own id element. Users has "has_many :groups, :through =>
2006 Apr 11
9
rails equivalent to asp''s Application object?
In asp you have an Application built-in object, which works just like the Session hash, but it lets you share information among all users of a given application. which is the rails equivalent??? and if there isn''t, how would you implement such a thing ? (there would be concurrency issues to take into account, in fact asp''s application object has some lock and unlock methods
2006 Jun 24
4
session alternatives
I have a web application that is getting larger all the time. There are now 3 separate models where I am storing the current find parameters in session hash and it''s beginning to seem to me that this might not be a good idea. Before I add another model to the mess - is there a better way? Do I have to create some table to store the current ''find'' criteria? It seems as
2006 Mar 15
10
Scaffold with Foreign Key
I have two tables: ------------------------------ drop table if exists users; create table users ( id int not null auto_increment, username varchar(100) not null, password varchar(20) not null, firstname varchar(20) not null, lastname varchar(20) not null, primary key (id) ) TYPE = InnoDB; ------------------------------ drop table
2006 Jul 07
5
Re: Rails migration issue
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ok, so rake migrate --trace gets you this: Khavi:~/Documents/WebCode/rails/clickcaster sgoodwin$ rake migrate -- trace (in /Users/sgoodwin/Documents/WebCode/rails/clickcaster) ** Invoke migrate (first_time) ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:migrate ** Execute migrate then it
2006 Feb 10
14
dynarch calendar and calendar helper usage
I am playing around with this and reference this wiki from RonR site... http://wiki.rubyonrails.org/rails/pages/CalendarHelper The error I am getting is: NameError in Placements#list undefined local variable or method `date_format'' for #<PlacementsController:0xb78f9ef4> RAILS_ROOT: script/../config/.. Application Trace | Framework Trace | Full Trace
2006 Mar 16
6
Sessions or lookups?
My application needs to know if a user is an administrator, for security and aesthetic reasons. At the moment, I store true/false in the session by doing the following at login: session[:user_is_admin] = authenticated_user.is_admin? Is this OK to do? Or should I really be doing the following every time: User.find(session[:user_id]).is_admin? (user_id is always in the session too) Is there
2006 Apr 21
2
newbie q about saving data to mysql
I have a two tables in my DB: users and products and I tried to set up a foreign key relationship between the id field in user and a user_id field in product. Despite redoing my scaffold the user_id does not show up when I go to create a new user. Is that normal? More importantly, how can I save the user id of the logged in user to the user_id field in my product table? Currently my create
2006 Feb 09
17
complicated finds are eating my sole
I abandoned ruby way for find_by_sql and still can''t get this... @myplacement = Placement.find_by_sql( "select * from placement where :intake_date >= beg_intake_date and :intake_date <= end_intake_date") just a simple date range...it''s killing me - If I knew how to load placement controller into irb, I could probably try out finds interactive mode... Thanks
2006 Feb 12
5
Passing Multiple Values In URL
Been a while since I programmed in Ruby and Rails and some of the basic concepts I just loose so quickly. This one I can''t find any examples of. I want to pass two pieces of information in my URL. The :id plus I want to pass my user_id. How do I pass it using the link_to? Stupid question I know... but I can''t find the answer. John Kopanas http://www.kopanas.com
2006 Apr 10
6
Single Table Mapping
This is pretty simple, but I must be missing the obvious. I''ve got a table that''s similar to this: USERS: - id int - username varchar(64) - password varchar(64) - role_id int ROLES: - id int - description varchar(16) I''ve had no troubles doing has_many relationships at all. But I want to map the user.role directly to the role model automatically (which sounds
2006 Jul 05
1
Securing my database with user session data
I have a few forms that adds information to a database, and one of the fields is "user_id" This field relates the stored information (in this case a "route") with the user who entered it. I have a few questions. First, is the controller the best place to set the user_id? Right now I am using, @route = Route.new @route.user_id = session[:user].id @route.save Should this
2006 Mar 20
16
Secret URLs and file downloads
I''m looking to do something similar to the "secret URLs" in Rails Recipes, however, with file downloads. I want to avoid providing direct URLs to people if possible. I have files on disk in public/, so it would be good if each user got a "unique" URL to each file that they are permitted to see (dealt with by a user_id/file_id table). Then they are only allowed
2006 Feb 13
10
Clearing browser history?
Hello everyone, I''ve got an app where, when a user logs out, I want the browser history to be cleared so no-one can go back and see what the user was doing. I remember seeing info on how to do this before - can''t find it in Google (the search terms "clear", "browser" and "history" aren''t that great!), which means I can''t remember