[Rails] Random password generation for new user on create

2012-03-14 Thread Roger Patrick
I have a user table in my database and what I wish to do is have a random password generated for each user on create which is then sent to their email address. I was wondering how I would assign the random password. I have the following in my view: <%= t('.username')%> <%= f.text_field :

[Rails] Assign random password.

2012-03-14 Thread Roger Patrick
Hello I have a user table in my database and what I wish to do is have a random password generated for each user on create which is then sent to their email address. I was wondering how I would assign the random password. I have the following in my view: <%= t('.username')%> <%= f.t

[Rails] Re: undefined local variable or method 'game'

2012-03-10 Thread Roger Patrick
No worries, I solved the code :) -- 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@googlegroups.com. To unsubscribe from this group, send emai

[Rails] Re: undefined local variable or method 'game'

2012-03-10 Thread Roger Patrick
Ah Cheers Bruno, that fixed my problem :) I am wondering if there is any way to do current_user as well as user in one post e.g. hi user (jon) the current_user (adam) has registered an interest in your post? -- Posted via http://www.ruby-forum.com/. -- You received this message because you

[Rails] undefined local variable or method 'game'

2012-03-10 Thread Roger Patrick
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" e

[Rails] ActionMailer message delivery content

2012-03-09 Thread Roger Patrick
I have the ability to send email to a user if a certain user has requested interest in their product. In my email I want to include certain information that is pulled from users but at the moment I am getting errors because it states that they are undefined despite these lines being used elsewhere

[Rails] ActionMailer message delivery content

2012-03-09 Thread Roger Patrick
I have the ability to send email to a user if a certain user has requested interest in their product. In my email I want to include certain information that is pulled from users but at the moment I am getting errors because it states that they are undefined despite these lines being used elsewhere

[Rails] Re: Re: Undefined Method

2012-02-23 Thread Roger Patrick
> def index > games_relation = case params[:console].present? > when true then Game.where(:console => params[:console]) > else Game > end > @games = games_relation.paginate(:per_page => 4, :page => > params[:page]).search(params[:search]) > end Thank you very much, that has solved my pro

[Rails] Re: Undefined Method

2012-02-23 Thread Roger Patrick
Valery Kvon wrote in post #1048505: > On 23.02.2012, at 22:23, Roger Patrick wrote: > >> website I receive the following error message which I assume is to say >> activerecord is not connecting: >> >> undefined method `find_by_console' for >> # > > At

[Rails] Undefined Method

2012-02-23 Thread Roger Patrick
Hi all, I am currently trying to get a bunch of links to to display all the related console records upon button click so e.g. If a user clicks on the Dreamcast link then I would like it to display all records that have Dreamcast stored as their console. I have the following example code in my ind

[Rails] Search by Console

2012-02-23 Thread Roger Patrick
Hi all, I am currently trying to get a bunch of links to to display all the related console records upon button click so e.g. If a user clicks on the Dreamcast link then I would like it to display all records that have Dreamcast stored as their console. I have the following example code in my ind

[Rails] Re: Re: rendering partial problem.

2012-02-22 Thread Roger Patrick
> <%= render @search.games %> > > means you have partial file: > > /app/views/games/_game.erb.html > > hello world!, i'm <%= game %> instance! > > > > http://guides.rubyonrails.org/layouts_and_rendering.html > > If you have an instance of a model to render into a partial, you can use > a

[Rails] Re: rendering partial problem.

2012-02-22 Thread Roger Patrick
Valery Kvon wrote in post #1048293: >> Showing C:/finalproject/app/views/searches/show.html.erb where line #3 >> raised: >> >> Missing partial games/game with {:handlers=>[:erb, :builder, :coffee], >> > > What about Missing partial games/game (/views/games/_game.html.erb) ? :) in my games view fol

[Rails] Re: rendering partial problem.

2012-02-22 Thread Roger Patrick
Javier Quarite wrote in post #1048286: > On Wed, Feb 22, 2012 at 2:02 PM, Roger Patrick > wrote: > >> Missing partial games/game with {:handlers=>[:erb, :builder, :coffee], >> >> Any ideas? >> >> Thanks >> R.Patrick >> >> > What do y

[Rails] rendering partial problem.

2012-02-22 Thread Roger Patrick
Can anyone help me? I have a problem that when I click on the search button I get the following error message: ActionView::MissingTemplate in Searches#show Showing C:/finalproject/app/views/searches/show.html.erb where line #3 raised: Missing partial games/game with {:handlers=>[:erb, :builder,

[Rails] Re: Re: Re: Re: Search of multiple columns

2012-02-22 Thread Roger Patrick
Walter Davis wrote in post #1048250: > On Feb 22, 2012, at 10:43 AM, Roger Patrick wrote: > >> end >> >> any ideas of what the problem might be? >> > > Didn't you have a search method that you wrote earlier? That may be > overriding the one in the Ransa

[Rails] Re: Re: Re: Search of multiple columns

2012-02-22 Thread Roger Patrick
Hey I installed the ransack gem and have added some basic code to my code but have received an error now on my page which is the followin undefined method `result' for # I have the following code in my gamescontroller.rb def index @q = Game.search(params[:q]) @game = @q.result(:dist

[Rails] Re: Re: Search of multiple columns

2012-02-21 Thread Roger Patrick
> Take a serious look at ransack. It's a very neat search gem, and it > allows you to create specialized search fields just by naming those It sounds really good Walter, do you have any links for Ransack, I just googles ransack - rails but it hasn't provided me with a documentation link. Thanks P

[Rails] Re: Search of multiple columns

2012-02-21 Thread Roger Patrick
Hey I found out my problem, it was because I did not have the % symbol in the last two search calls, all works fine now. Do you know how I would be able to make it as three separate search boxes and buttons instead of all going in to one? All I know is how to search every column under one form

[Rails] Search of multiple columns

2012-02-21 Thread Roger Patrick
I am currently writing a search method for my rails applications and at the moment it works fine. I have the following in my game.rb: def self.search(search) if search find(:all, :conditions => ['name LIKE ? OR genre LIKE ? OR console LIKE ?', "%#{search}%", "#{search}", "#{search}"]) else