similar to: Redirect_to from initialize method

Displaying 20 results from an estimated 6000 matches similar to: "Redirect_to from initialize method"

2006 Jan 24
3
AJAX Preview & Edit Page Problem
I''m new to RoR and have started building my first application. I''m building an account sign-up controller and I have two questions: 1. What is the best way to pass form params between methods in my sign-up controller? The solution I''m using seems too hacky and there''s got to be a something more elegant. I''m instantiating User.new to capture the
2006 Feb 13
1
Change redirect after method ''redirect_to''
I want to be able to change the redirection url after I called redirect_to, is that possible? My specific use case is that I want to change the default redirection of "Login Engine" method signup, but I am seeing no other way then copy/past and change the parameters of redirect_to. This questions extends to render method as well, I want is to avoid DoubleRenderError exception. --
2006 Apr 12
3
acts_as_authenticated trouble
First off, I''d like to address that I''m n00bs. I''ve read the README and blogs associated with this plugin, and there really isn''t too much documentation. I have the newest version of rails,ruby, and acts_as_authenticated installed. #The setup I set up the acts_as_authenticated in the following manner. *created a table called "accounts" in the
2007 Jan 09
1
assert_redirected_to not working as expected
I''ve installed the "acts_as_authenticated" plugin and made some modifications to the controller (app/controllers/account_controller.rb) "signup" module as follows: === def signup @page_title = ''Create Account'' @user = User.new(@params[:user]) if request.post? if @user.save session[:user] = User.authenticate(@user.login,
2007 Sep 07
2
My controller became fat trying to handle multiple models - need guidance please
Hello all. I am experiencing something that has to be fairly common in the rails world, but I haven''t found a clean solution yet. I have a SignupController that handles multiple models in a single form. Those models are User, UserProfile, CreditCard, Subscription, and Order. When the form is filled out and posted, I want to do exactly what I would do if the form was only for a single
2006 Apr 17
2
probably easy q: flash before redirect
I''m a little perplexed why this isn''t working: private def check_authorization user = User.find(session[:user]) if user.level == 100 flash[:notice] = "welcome, admin" else flash[:notice] = "ha ha" redirect_to :controller
2011 Mar 17
7
Beta Invitation in Rails 3, little problem
INVITATION BETA EMAIL I have in the email that the app send to friend''s email address ------------------------ You are invited to ExampleApp.com click below to signup http://localhost:3000/signup.efweiuvwnjernfwkefwebhsohj ------------------------ But I have a dot in the url beteween http://localhost:3000 and the token I wish the following url
2006 Jun 08
2
LoginEngine: undefined method `generate_security_token''
Hi there, I''m trying to set up LoginEngine with Rails 1.1.2 on Ruby 1.8.4 on a Windows XP box and the log is reporting: undefined method `generate_security_token'' for #<User:0x39436a0> Rendering user/signup Rendered user/_edit (0.01600) Rendered user/_password (0.01600) Rails appears to be failing on key = @user.generate_security_token in user_controller.rb in the
2006 Apr 14
5
state_models plugin and file_column?
I was looking at Kyle Mawell''s extremely nifty-looking StateModels plugin http://www.kylemaxwell.com/articles/2006/02/06/fun-with-single-table-inheritance and before I go down the road with it, I was wondering if anyone has used it with file_column. The way file_column deals with an uploaded file -- by storing it to the filesystem in a path that employs the model name and id --
2005 Oct 12
4
Validating 2 related models at once not working
Hello, I have a form that submits data to two related models/tables. One is Customer the other is Address. Validation for Customer works fine but not for the Address. Class Customer < ActiveRecord::Base has_one :address validates_presence_of :login, :password, :email validates_associated :address end Class Address < ActiveRecord::Base belongs_to :customer validates_presence_of
2006 Aug 08
4
Creating a child simultaneously with parent via form
Hi there I''ve got a user model and an address model; a user has_many addresses. A user object can be created via an html form which also allows for an initial address to be created. I''ve got a controller method working to save both objects via the form, but I suspect I can achieve this in a more rails-esque manner. Here is my controller method: def signup @user =
2006 Jul 04
1
LoginGenerator Problem
I am trying to make a barebones login system based on this example (which in turn is just standard RoR login) but when I enter a user name and password, it says the login is unsuccessful every time. I am not sure where I am going wrong. Here is all relevent information CREATE TABLE `users` ( `id` int(6) unsigned NOT NULL auto_increment, `login` varchar(20) NOT NULL default
2006 Jul 06
4
has_one, belongs_to - I am just not getting it
Let me preface by saying i''m a total noob at ruby/rails. :-) For some reason, I am just not grasping the concept of has_one & belongs_to... I''m working on a project that includes user authentication, and 3 different types of user profiles. User profiles are either "fan", "band", or "venue" objects, and user logins are "user"
2006 Jan 26
1
Transactions for multiple models
I have users and companies tables where users belongs_to companies. def signup @company = Company.new(params[:company]) @user = User.new(params[:company]) @user.company = @company if @user.valid? and @company.valid? @company.save @user.save end end How can I make this into a transaction? Is this a candidate for a distributed transaction? If so, from what I understand from the API,
2005 Sep 02
7
Form to update two tables
Hello there, this is probably a very simple problem but I''m stuck. I''m following the Login generator tutorial from rubyonrails. It''s all worked fine so far. But I want to add a bit more functionality so that when a user signs up in addition to chosing a login name and password they type in a company name which is added to a seperate table called COMPANIES. The id
2008 Jul 09
1
loverays invites you to join Zorpia
Hi speex-dev! Your friend loverays from , just invited you to his/her online photo albums and journals at Zorpia.com. So what is Zorpia? It is an online community that allows you to upload unlimited amount of photos, write journals and make friends. We also have a variety of skins in store for you so that you can customize your homepage freely. Join now for free! Please click the following
2006 Apr 25
5
Authorisation question
My authentication (signup/login) is up and running in my app, now I need to implement an authorisation system. Its not going to be a complex one. One admin (me) and then normal members and premium members. Any tutorials or tips on a simple way to get this running? Thanks. -- Posted via http://www.ruby-forum.com/.
2006 Jul 07
1
question about routes and using flash for navigation
I have a flash movie that I''m using for site navigation.. I have links such as: ''/site/signup'', ''/site/login'' and ''/site/faq'' where site is my controller and signup, login or faq are my actions.. I also have the following routes defined in routes.rb: map.connect "/", :controller => "site", :action =>
2005 Aug 26
2
Salted Login Hash Woes
I had the Salted Login Hash Generator working at one point and then it just stoped working. It was around the time that I changed hosts and I think that it just might not be able to connect to the new server. I have tried everything though and it just doesn''t seem to work out. I''m now thinking that maybe it has to do with something else that I changed in the project. Is
2006 Jun 24
1
DRY up link_to_remote and its url_for
In an attempt to provide a gracefully degradable link_to_remote, I repeat myself every time: <%= link_to_remote(''Signup'', {:url => {:controller => ''user'', :action => ''signup''}}, {:href => url_for(:controller => ''user'', :action => ''signup'')}) %> Looked around the RDoc &