Displaying 20 results from an estimated 11000 matches similar to: "ActionMailer message delivery content"
2012 Mar 10
4
undefined local variable or method 'game'
I am doing a web shop assignment and have got a problem with my action
mailer.
I get an error undefined local variable or method ''game''
I have the following in my mailer:
def game_interest(user, game)
@user = user
@game = Game
mail :to => user.email, :subject => "Game Interest"
end
and the following in my controller:
def email
@game =
2010 Sep 03
1
Action Controller Error: undefined local variable or method `current_user'
Newbie learning Rails. I''m currently on Chp9 here:
http://railstutorial.org/chapters/sign-in-sign-out#top
At the end of the tutorial, rails is erroring (see below). being new
to Rails and after having checked the tutorial... How do you resolve
this kind of error. It''s saying current_user is not defined, and it is
supposed to be defined with/Sites/sample_app/app/helpers/
2012 Aug 07
9
How do I force link_to/form helpers to use the superclass name in the path instead subclass?
I want my helpers to generate paths using a superclass instead of the
subclasses. Assuming I have Owner and Member that both inherit from User,
rails will use the current objects class name when generating paths:
Let''s say current_user is a mod: <%= link_to current_user.name,
current_user %> will generate "/mod/:id". I want to force it to generate
2010 Nov 20
6
syntax error, unexpected tSTRING_BEG
Rails is throwing this error
C:/Ruby/Depot/app/views/products/index.html.erb:28: syntax error,
unexpected tSTRING_BEG, expecting keyword_do or ''{'' or ''(''
...er.privilege == 50 ? {link_to ''Show'', product} : ''a'' );@out...
in line
<%= current_user.privilege == 50 ? {link_to ''Show'', product} :
2010 Apr 20
5
Spring Cleaning
Right now in my view, I have a whole HUGE clump of
<% if current_user %> and then <% if current_admin %> and then <% if
current_teacher %> and then all that other stuff in my view.
I have a ginourmous chunk of if and else statements in my views... is
there a way to make it prettier? The if and else''s almost all have the
same functions, expect for some minor changes.
2007 Aug 11
2
Rspec and acl_system2 plugin
Hello,
I''m trying to spec a Rails application using the couple
restful_authentication/acl_system2 plugins.
In my admin layout, I put the following code :
<% restrict_to "admin" do -%>
<ul id="admin-tabs">
<li> /users Users management </li>
</ul>
<% end -%>
Then in my spec file
2008 Jan 30
2
Where can I get "authenticate_with_http_basic"?
Hi,
I just installed Rails 2.0.2
[root@mymachine easyx]# ruby --version
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux]
[root@mymachine easyrx]# gem install rails --include-dependencies
Need to update 16 gems from http://gems.rubyforge.org
................
complete
Successfully installed rails-2.0.2
[root@remandev easyrx]#
But I''m getting this error in my restful_authentication
2010 Jul 28
1
paperclip, authlogic and callback issue
I use authlogic for authentication and paperclip for handling user''s
profile picture attachments.
I use the following method to get the current_user
def current_user_session
return @current_user_session if defined?
(@current_user_session)
@current_user_session = UserSession.find
end
def current_user
return @current_user if defined?(@current_user)
2010 Apr 16
4
DEEEEPLY nested
Hello,
i have "a" has many "b", "b" has many "c", and "c" has many "d"
Now... "d" is a user model, and I have a current_user helper method
defined.
If i navigate to an "a" show page, how can I make sure that my
current_user ("d") is part of that "a"? meaning how can i make sure
that
2006 Oct 09
5
Problem setting variables in ApplicationController.
I''m dynamically generating menu options based on the currently logged
in user: current_user.
My menus are setup on the applicatin.rhtml file. The current_user is
defined in the application controller. But, attempting to assign it a
value while in the application controller results in an ''undefined
method'' error.
ApplicationController ....
def current_user
@cu =
2006 Jan 16
16
acts_as_authenticated current_user in a model?
What do I need to do to be able to use an acts_as_authenticated
current_user in a model?
Is there some sort of include or require I can do some where that would
allow this?
**********************************************************
Here is what I am trying to do:
**********************************************************
class Setting < ActiveRecord::Base
before_create :created_by_user #
2006 Aug 16
3
calculate method is gone once I use ''find''?
Could someone please explain why this works:
current_user.accounts.sum(:balance)
But not this:
current_user.accounts.find_all_by_active(true).sum(:balance)
For the latter Rails tells me sum is an undefined method. It seems like
I lose the ActiveRecord methods when I call ''find''?
This (simpler) does not work either:
current_user.accounts.find_all.sum(:balance)
Thanks!
--
2009 Oct 28
1
Authlogic Page View Authentication Help
Hi:
I am a newbie at ROR, and I am grasping my head around Authlogic. I am
having hard time trying to figure out how can I do the following:
in my application controller I have the following helpers:
filter_parameter_logging :password, :password confirmattion
helper_method :all
private
def current_user_session
return @current_user_session if defined?
(@current_user_session)
2002 Jun 03
1
What is so bad about primaryGroupID=513?
I try to set up Samba 2.2.4 / LDAP as a PDC and it almost works. The
only thing I don't understand is why a domain user can't have a
primaryGroupID of 513 (which looks like it should be a safe default).
But if I set it, login is denied with an error C0000078 on the client,
and something like
[2002/06/03 10:32:28, 3] smbd/sec_ctx.c:set_sec_ctx(314)
setting sec ctx (65534, 65534) -
2007 Aug 21
2
using restful_authentication current_user inside controller specs
I''m using restful_authentication in my app and I have the before filters in
my application rhtml:
before_filter :login_required
around_filter :set_timezone
around_filter :catch_errors
Currently I have them commented out while rspec''in but I''ll need to add them
in my specs.
def create
@ticket = Ticket.new(params[:ticket])
@ticket.user = current_user
if
2006 Apr 24
5
Custom pagination
I am trying to paginate objects from a has_many/:through relationship
using Paginator.
current_user.things returns the objects that I''d like to paginate. For
testing, I tried to make it 1 item per page. I initialise the paginator
as follows:
@thing_pages = Paginator.new(self, current_user.things.count, 1,
@params[''page''])
I don''t know how to obtain
2007 May 17
4
How to mock helpers in view specs ?
Hi all,
I am mocking the following Rails view (inside a partial):
<%= render :partial => "forums/forum",
:collection => forum_category.forums.readable_by(current_user? ?
current_user : nil) %>
My spec fails with the following message:
1)
ActionView::TemplateError in ''forum_categories/index (anonymous user)
should only render forums accessible to anonymous
2011 Feb 05
4
Questions about Chapter 9: Sign in, Sign out of RoR Tutorial | Learn Rails by Example
Hello
Finished reading chapter 9 and im a little bit confused.
1. In the tutorial, Modules are used instead of creating a Model and
working in a class inside a module , like in authenticating passwords.
Wouldn''t that be possible? Or is it unnecessary since we''re not
messing with a database in terms of storing data?
2. what is the difference between session[:remember_token] =
2007 Aug 23
3
recording current_user
Hi,
Another noob here I am afraid! I have a questuin about the current_user
method that comes with AAA.
I have AAA set up and working fine and if i put <%=
self.current_user.login %> into a view it shows the login name as
expected on the page.
What I cant work out is how to record this into the database when the
user completes a form.
My app so far only has two models.
2008 May 06
1
check_friendship method only returning value of last pair
Hello, I''m new to facebooker and ruby, so not sure if the issue I am
having is due to my misunderstanding or a bug in facebooker plugin.
Here is what I have:
def show
@current_user ||= facebook_session.user
@member ||= params[:id].to_s==@current_user.id.to_s ?
@current_user : Facebooker::User.new(params[:id])
#for each of current_user''s friends, check if they are