Search Results

Search found 4 results on 1 pages for 'psychonetics'.

Page 1/1 | 1 

  • Combine 3 select fields and validate as one in my User model in ruby on rails 3

    - by Psychonetics
    Ok I have 3 select boxes for selecting date of birth. I have constants setup in my User model to provide months, years etc.. Anyway I can successfully validate these select boxes separately. What I want to do is combine the :day, :month and :year and store in :birthday and validate the whole date as one so I can return 1 error rather than 3 separate ones. Also doing this will make it easier to store the validated date in my birthday field in my database. Part of my form <td> <%= f.input :day, :required => false, :label => "Birthday: " , :prompt => "Day", :collection => User::DAYS %></td> <td> <%= f.input :month, :label => false, :prompt => "Month", :collection => User::MONTHS %> </td> <td> <%= f.input :year, :label => false, :prompt => "Year", :collection => User::YEAR_RANGE %> </td> Part of User model MONTHS = ["January", 1], ["February", 2], ["March", 3], ["April", 4], ["May", 5], ["June", 6], ["July", 7], ["August", 8], ["September", 9], ["October", 10], ["November", 11], ["December", 12] # finish this DAYS = 1..31 # finish this START_YEAR = Time.now.year - 106 END_YEAR = Time.now.year YEAR_RANGE = START_YEAR..END_YEAR class User < ActiveRecord::Base attr_accessor :day, :month, :year validates_presence_of :day, :message = 'What day in a month was you born?' validates_presence_of :month, :message = 'What month was you born?' validates_presence_of :year, :message = 'What is your year of birth?' end

    Read the article

  • Jquery/Javascript gmail style stuff for message inbox, such as select all message using checkbox etc

    - by Psychonetics
    I am enjoying the fact that I'm here building a private message inbox for my website after building a full user signup/login and activation system when a few months ago I thought I wouldn't have enough patience to learn this stuff. Anyway to my question. I am currently building the private message inbox for my users and wondering if there are any jquery/javascript stuff I can use to make my inbox more like the gmail inbox. E.G. Gmail allows you to select all read messages or unread or starred or unstarred or none of the messages using a checkbox. I would like to add this kind of feature to my website and I'm sure the easiest way to achieve this would be using a jquery/javascript script. I would appreciate if someone could provide some links or info to where I can find several of these types of scripts to use with my inbox page. Thanks EDIT: Would also like to note that I would like the checkbox to be in a dropdown just like gmails.

    Read the article

  • Codeigniter achor producing dodgy link in email inbox.. what could the problem be?

    - by Psychonetics
    My application is emailing out fine but the email I receive displays incorrectly. Rather than have text and a simple "click here to activate" link it doesn't. it shows this instead: Hi user1, please click the following link to activate your account <a href="http://mysite.com/activation/fzyZuyxVAzZS2koVg5UFjfVjlcLNcrzp">ssss</a> Here is the code from my model that sends email to user when they request activation email. $this->load->library('email'); $this->email->from('[email protected]', 'my site'); $this->email->to($result[0]->email); $this->email->subject('my site - Activate your account'); $this->email->message('Hi ' . $result[0]->first_name . ', please click the following link to activate your account ' . anchor('http://mysite.com/activation/' . $new_activation_code, 'click here to activate')); $this->email->send(); Also the mail always ends up in my spam folder.

    Read the article

  • Codeigniter: A nice straight forward tutorial on how to build a reset password/forgotten password?

    - by Psychonetics
    I've built a full sign up system with user account activation, login, validation, captcha etc. To complete this I now need to implement a forgot password/reset password feature.. I have created one function that generates a random password 8 characters, another method that takes that random password word and applies sha1 and hashing. Also one that takes that hashed password and stores it in a table in the database. I will keep these methods to one side as they might come in handy later on but for now I would like to know if anyone can point me to a nice tutorial for creating a password reset feature for my website. Thanks in advance

    Read the article

1