Displaying 20 results from an estimated 29 matches for "root_url".
2009 Dec 02
14
root_path and root_url undefined
Hi all,
I''ve just started working on another RoR project after a couple of months
away. I''m having trouble with named routes, specifically root_*
In previous apps I''ve used root_path and root_url without any problems, but
in this project (2.3.2 - the same as my last project where I used it) it
comes up undefined.
I''ve double and triple checking my routes.rb, and it all appears fine. I''ve
defined map.root and removed index.html. I just can''t think what could be
ca...
2011 Feb 15
5
Path and Url
Hello everyone, what''s the real difference between root_url and root_path in
Rails, for example. Apparently both lead to the same route in the
application.
Thanks!
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocF...
2012 Feb 20
1
respond_to format.json not being called
...osest(''.modal'').find(''form'');
$.post(''/messages'', form.serialize(),
function(data, status, xhr){
console.log(data);
});
);
});
However, when this hits the controller, ''console.log(data)'' outputs html
(either root_url or the validation array).
The code in the controller looks like:
respond_to do |format|
if @m.save
format.html {redirect_to root_url, :notice=>"Message sent"}
format.json {render :json=>@m, :status=>:created, :location=>@m}
else
format.html {render :action=&g...
2009 Jan 30
3
Pass a variable from rake to steps file in cucumber
...t.cucumber_opts = "--profile #{profile}"
end
I would like to have access to the "browser_type" variable in my "Before do"
in my_steps.rb file.
## my_steps.rb
Before do
$browser = Selenium::SeleniumDriver.new($server_host, $server_port,
"browser_type", $root_url, $time_out)
end
Thanks for the help.
--
View this message in context: http://www.nabble.com/Pass-a-variable-from-rake-to-steps-file-in-cucumber-tp21746008p21746008.html
Sent from the rspec-users mailing list archive at Nabble.com.
2010 Jul 19
6
Setting a root_url
I know how to setup a roo_url using map.root in "routes.rb".
The issue I''m currently having is as follows:
I walking through this Rails cast regarding Authlogic:
http://railscasts.com/episodes/160-authlogic
I decided that I make my map.root the "login" page, that is, the
index.html.erb of the user_sessions_controller.
So, what I did is typed the following in the
2012 Mar 10
4
undefined local variable or method 'game'
...me Interest"
end
and the following in my controller:
def email
@game = Game.find(params[:id])
respond_to do |format|
user = @game.user
email = user.email
g = GameTrade.game_interest(user, game)
g.deliver
format.html { redirect_to root_url }
format.json { render json: @game }
end
end
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez...
2009 Sep 24
2
How to generate password automatically using authlogic..
I have problem , i want to generate password automatically
where can i manipulate :password and :confirm_password in action create
def create
@user = User.new(params[:user])
if @user.save
flash[:notice] = "Registration successful."
redirect_to root_url
else
render :action => ''new''
end
end
--
Posted via http://www.ruby-forum.com/.
2010 Mar 02
1
localized host in ActionMailer Views
Hi,
I''ve got some domains , lets say example.com and example.de and I want
that the link in a ActionMailerView contains the correct localized
host e.g. with <%= @root_url %> .
Currently the host is set in the environment.rb with
"config.action_mailer.default_url_options = { :host =>
"example.com" }".
How can I set the host dynamically and localized? I''m sending my mails
though a Delayed Job.
Thanks.
greetings
LeonS
--
You recei...
2012 Jul 15
1
Facebook redirect
...Redirected to
> https://www.facebook.com/dialog/oauth?client_id=439021042804757&redirect_uri=http://localhost:3000/
> Completed 302 Found in 1ms
And my code to redirect is:
> redirect_to
> "https://www.facebook.com/dialog/oauth?client_id=439021042804757&redirect_uri=#{root_url}"
Hope you can help me
Best
Simon
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/wAc7LQGAAigJ.
To post to this group, send emai...
2008 Feb 26
1
problem with posting with acts as taggable on steroids
...method `tag_with''
i''ve already added acts_as_taggable to the model
and on the controller the code for creating the post is:
def create
@post = Post.new(params[:post])
@post.tag_with(params[:tag_list])
@post.user = current_user
if @post.save
redirect_to root_url
else
render :action => ''new''
end
end
and the form on the view has the tagging code:
<p><label for="tag_list">Tags</label><br/>
<%= text_field_tag ''tag_list'', @post.tags.collect{|t| t.name}.join(" &q...
2009 Aug 02
13
NoMethodError in User sessionsController#create - Authlogic
...r_session_controller.rb:
class UserSessionsController < ApplicationController
def new
@user_session = UserSession.new
end
def create
@user_session = UserSession.new(params[:user_session])
if @user_session.save
flash[:notice] = "Successfully logged in."
redirect_to root_url
else
render :action => ''new''
end
end
def destroy
current_user_session.destroy
flash[:notice] = "Successfully logged out."
redirect_to root_url
end
end
I was trying to google this error, but with no success, so I hope I will
find some help here
gem...
2011 Mar 17
7
Beta Invitation in Rails 3, little problem
...n(@invitation,
signup_url(@invitation.token)).deliver
format.html { redirect_to(@invitation, :notice => ''Invitation
was successfully created.'') }
format.xml { render :xml => @invitation, :status => :created,
:location => @invitation }
redirect_to root_url
else
format.html { render :action => "new" }
format.xml { render :xml => @invitation.errors, :status =>
:unprocessable_entity }
end
end
end
I BELIEVE IS A LITTLE PROBLEM BUT I DON''T UNDERSTAND WHERE IS MY MISTAKE
Thanks for read my po...
2013 Aug 26
2
linkedin login using omniauth
...r.oauth_expires_at = Time.at(auth.credentials.expires_at)
user.save!
end
end
/controller/sessions_controller.rb
class SessionsController < ApplicationController
def create
user = User.from_omniauth(env["omniauth.auth"])
session[:user_id] = user.id
redirect_to root_url
end
def destroy
session[:user_id] = nil
redirect_to root_url, :notice => "Signed out!"
end
end
/config/initializer/omniauth.rb
OmniAuth.config.logger = Rails.logger
Rails.application.config.middleware.use OmniAuth::Builder do
provider :facebook, ''###########...
2013 Nov 10
3
accepts_nested_attributes_for how, example
I have following tables with following models:
users(id, role_id) *has_many :entries*
categories(id, category_name) *has_many :entries*
entries(id, category_id, user_id) *belongs_to :user, belongs_to
:category, has_one :storage*
storages(id, title, content, entry_id)* belongs_to :entry*, *has_one
:vote*
votes(id, count, storage_id) *belongs_to :storage*
Now,
2011 Apr 20
1
Omniauth facebook authentication failure
...[''user_hash''][''gender'']
#save users profile
if user.profile.save
flash[:notice] = "Signed in with "+omniauth[''provider'']
#sign user in
sign_in_and_redirect(:user, user)
end
else
redirect_to root_url, :notice => "Authentication failed, please try
again!"
end
when ''twitter''
session[:omniauth] = omniauth.except(''extra'')
redirect_to "#{root_url}confirm-email"
end
end #close of if statement
end...
2011 Jul 11
2
Can't get this Rspec test to pass
...ock_herd_ration)
response.should be_success
end
end
and here''s my controller method:
def new
@herd_ration = HerdRation.new
@herd = Herd.find(params[:herd_id])
if @herd
respond_with(@herd_rations, :layout=> !request.xhr?)
else
redirect_to(root_url, :notice => ''No herd selected for ration.'')
end
end
[/code]
Here''s the catch - we have this groovy little plugin that globally enforces
a model scope via a session id, in this case: session[:operation_id].
Here''s the code for the plugin:
[code]
module...
2010 Nov 07
1
Strange authlogic logout behavior
...n.save
flash[:notice] = "Login successful!"
redirect_to :controller => "list"
else
render :action => :new
end
end
def destroy
current_user_session.destroy
flash[:notice] = "Logout complete. Have a nice day!"
redirect_to root_url
end
end
[/code]
application layout file snippet
[code]
<% if current_user %>
<li><a><%= link_to current_user.login, edit_user_path(:current)
%></a></li>
<li><%= link_to "logout", user_session_path, :method => :delete %></li>
&...
2011 Nov 23
0
Awesome nested set - how to put there items?
...a controller I do this:
def create
@user = User.new(params[:user])
respond_to do |format|
if @user.save
save_tree = TreeStruct.create!(:user_id => @user.id)
save_tree.move_to_child_of(params[:parent])
format.html { redirect_to(root_url, :notice => ''OK.'') }
format.xml { render :xml => @user, :status => :created,
:location => @user }
else
format.html { render :action => "new" }
format.xml { render :xml => @user.errors, :status =>
:unpro...
2013 Jul 05
0
Sign in and sign out
...torial.org/chapters/sign-in-sign-out#top to sign in
and sign out my app. I implemented the same configuration as it said:
*sessions_helper.rb*
def sign_out
self.current_user = nil
cookies.delete(:remember_token)
end
*sessions_controller.rb*
def destroy
sign_out
redirect_to root_url
end
*application.html.erb*
<%= link_to "Sign out", signout_path, method: "delete" %>
*routes.rb*
match ''/signout'', to: ''sessions#destroy'', via: ''delete''
I am able to sign in, but I can''t sign out. Th...
2011 Jun 05
1
Cancan redirect back at AccessDenied
Hello
I have a rails 3 app and I am trying to implement the redirect back
action at access denied for cancan.
If I try this in my application_controller:
rescue_from CanCan::AccessDenied do |exception|
redirect_to :back
end
It gives the following error:
No HTTP_REFERER was set in the request to this action, so
redirect_to :back could not be called successfully. If this is a test,
make sure