Find Web browser user agent using rails 3


Hi friends, In rails 3 there is a easy way to Detect the web browser user agent . 🙂 By adding the one line in the controller page, we can get the UA.(@user_agent = request.env[‘HTTP_USER_AGENT’]) In /app/controllers/users_controller.rb def index  @users = User.all @user_agent = request.env[‘HTTP_USER_AGENT’] In /app/views/users/index.html.erb <%= @user_agent %> That’s All !!!  🙂 🙂Continue reading “Find Web browser user agent using rails 3”

Multiple File uploading in Rails3 Application using “Papercilp”


Hi friends, Lets see how to upload multiple files in a rails 3 application. First create a new rails project and go inside of the project directory. $ rails new fileuploading $ cd fileuploading Add the Gms in  following “Gemfile” gem ‘nifty-generators’ gem ‘paperclip’ And  bundle install it. Now we have to create a scaffold.Continue reading “Multiple File uploading in Rails3 Application using “Papercilp””

Google maps in Rails3 Application — Sample Application


Hi friends, (New update: For new version(0.9.1) check Jay’s comment below) (Update: this tutorial works only on gem version 0.7.7 and won’t work on latest gem version 0.8.7) Using a gmaps4rails gem to display a map in our application create a rails application using, $ rails new gmaps $ cd gmaps Add this Gem inContinue reading “Google maps in Rails3 Application — Sample Application”

Sending One Time Password via SMS Using Rails3 and SMSAPI


Hi friends, My need was send one time password via e-mail/sms ,who registered with their E-mail/mobile no. Lets see “How to send SMS using Rails3 application and smsAPI” At first we need a smsapi to send SMS via Rails3 application. There is a site, which provides FREE API to send SMS via programming. So, hereContinue reading “Sending One Time Password via SMS Using Rails3 and SMSAPI”

Sending SMS via “freesmsapi.com”


Hi friends, I found a site which sends sms via website and programs. http://freesmsapi.com. They provides their own API and programing codes in ruby,python.php.java,c,c#., etc., First we have to signup with our own domain and register with mail-id and phone number. that’s all. 🙂 Ex code in ruby: Now i’m trying to integrate this code into rails3Continue reading “Sending SMS via “freesmsapi.com””

How to Send a mail using Gmail account with Rails3, ActionMailer and SMTP


Hi friends, Action Mailer: Action Mailer is a framework for building e-mail services. You can use Action Mailer to receive and process incoming email and send simple plain text or complex multipart emails based on flexible templates. Lets see how to setup the actionmailer with Gmail SMTP. First we have to create a rails applicationContinue reading “How to Send a mail using Gmail account with Rails3, ActionMailer and SMTP”

Actionmailer


Hi frinds, I created a module for random password generation using “Actionmailer” in rails 3  🙂 And also I’m trying to find a solution for sending password to mobile via sms. but i didn’t succeed so for. 😦 I think their is no sms provider in india. If anyone know, pls let me know  !Continue reading “Actionmailer”

How to custamize DATE field in Rails 3


Hi friends, When we use “date” field in rails (i.e) Date of birth, it usually shows 11 years. (i.e) The current year + previous 5 years + next 5 years. But if we need a list of particular years like 1970 to 1980, we can do that by specifying, the “:start_year” and “:end_year“, in theContinue reading “How to custamize DATE field in Rails 3”

Facing Problem wit heroku :(


Hi friends, Today fully me and my friend Rakesh spent time wit this “nanbenda” project. 🙂 but i faced problem wit “heroku” deployment 😦 not ly one time, i deleted, created, deployed…. deleted, created, deployed… deleted, created, deployed… But i didn’t got the output from “heroku” site. My project successfully ran @localhost 🙂 But didn’tContinue reading “Facing Problem wit heroku :(“