[Rails] Re: Logical help related to habtm..

2015-05-04 Thread Hemant Bhargava
Joel Dezenzio wrote in post #1173071: > I hate to go overboard on this question but I think a lot can be learned > here. > > Your question dives into several sub-topics at once (database > normalization, model associations, and ERD structures). I would > concentrate on the following first: > > Ev

[Rails] Re: Logical help related to habtm..

2015-05-04 Thread Hemant Bhargava
I could have used the Enums as well but I preferred to go with boolean fields. I will have three boolean fields(OLD, NEW, VERY_OLD). As I wrote earlier, values could be multiple as well. So, If status is OLD and VERY_OLD both, then I will mark "is_old" & "is_very_old" columns as true/1. -- Poste

[Rails] Logical help related to habtm..

2015-05-04 Thread Hemant Bhargava
Hi, Not being an expert in RoR, I have a logical query. It is not a programming question. Situation is : I have a Book model and status of the book can be anything from NEW, OLD, VERY_OLD. It can be NEW, OLD both or it could be OLD and VERY_OLD both. What would you suggest to implement in such

[Rails] Re: HTML5 support with rails 4.0.2

2015-03-17 Thread Hemant Bhargava
Found it on stackoverflow.. Rails does support HTML5, try this in your view = f.email_field :email Just make sure your layout starts with tag (which is added for you by default). You should read more about this and other view-related helpers in the excellent Guide on the topic, these HTML5 he

[Rails] HTML5 support with rails 4.0.2

2015-03-17 Thread Hemant Bhargava
I just started learning Rails 4.0.2. I was wondering if there is anything(any gem?) which allows the support of html5 in rails .html.erb pages.. So basically, lets say, If I create an email field in my .html.erb, It would look like as : <%= f.text_field :email %> And in html5, you can simply use

[Rails] Re: Re: Installation issue with ruby on rails/sqlite3..

2015-03-05 Thread Hemant Bhargava
> Follow this link, > http://stackoverflow.com/questions/15480381/how-do-i-install-sqlite3-for-ruby-on-windows Sushruth, Naah it did not help. Thanks for your prompt reply though. I am still with the same problem of ERROR LoadError : Please install the sqlite3 adapter: `gem install activerecord-

[Rails] Re: Installation issue with ruby on rails/sqlite3..

2015-03-05 Thread Hemant Bhargava
> http://stackoverflow.com/questions/17643897/cannot-load-such-file-sqlite3-sqlite3-native-loaderror-on-ruby-on-rails > Hi Sushruth, That's nice. I can see that problem going away now. But again, I find myself hitting another error now. I do not understand why installation is such a pain. Should'

[Rails] Installation issue with ruby on rails/sqlite3..

2015-03-05 Thread Hemant Bhargava
Folks, I just used rails installer to install ruby on rails on my windows 8 machine. I was happy to see that my installation went through without any issue. As most of you know, it creates a dummy rails app on installation, todo app. I thought of running this before jumping into something else. S

[Rails] Re: Re: Re: Stuck with rails installation.

2015-03-03 Thread Hemant Bhargava
Sushruth, Thanks. This was a good lead. But my problem does not end here. Now, I seems to have caught in some other mess, it seems. After copying the certificate from(gist.github..), I tried to start my server again. All it gives me is: 'require' : can not load such file -- sqlite3/sqlite_nativ

[Rails] Re: Re: Stuck with rails installation.

2015-03-03 Thread Hemant Bhargava
Norbert Melzer wrote in post #1169549: > He is asking you to share the errormessage you get when trying to > install > manually, commands you invoke included! Oh an please don't screenshot, > but > copy and paste your terminal. > Am 03.03.2015 15:05 schrieb "Hemant B

[Rails] Re: Stuck with rails installation.

2015-03-03 Thread Hemant Bhargava
> > Why not? > I am sorry! Is that a question or you are asking me to share my GemFile? -- 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 unsubscribe from this group and stop receiving emails

[Rails] Re: Stuck with rails installation.

2015-03-03 Thread Hemant Bhargava
Paramnoor Singh wrote in post #1169545: > Did You do some changes in config database.yml file for accessing > database > also which database you are using? > Hey Paramnoor, Ohh. Do I need to install MySql first? I am not using any database right now. I relying on sqlite completely. -- Posted vi

[Rails] Stuck with rails installation.

2015-03-03 Thread Hemant Bhargava
Hello folks, I have downloaded the rails installer(ruby 2.1) from "http://railsinstaller.org/en";. Installed it on my 32 bit machine. It installed nicely. It even created a skeleton app. Inside that app, I did a "bundle install" just to make sure that every gem come in my application. I could see

[Rails] link_to_remote helper messed up?

2012-01-11 Thread Hemant Bhargava
_tag :all, :recursive => true %> Do you guys(Rubyities) have anything to give for this? - Hemant Bhargava -- 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 gr

[Rails] Re: Javascript file path

2011-12-06 Thread Hemant Bhargava
Hello Clan, Thanks for your reply. Actually i have the js file in "script" directory not in "public" directory. Is it ok if i do:- root_url + "/script/file_name.js" ? - Hemant clanlaw wrote in post #1035231: > On 5 December 2011 19:05, Hemant Bhargava w

[Rails] Javascript file path

2011-12-05 Thread Hemant Bhargava
Hello, I googled for it but did not find satisfied answer. Problem is that i have a javascript file which need to be loaded on only one page. Also, i am using recursive => true with javascript_include_tag in layout file. So, what i have done is that i moved javascript file to public directory and

[Rails] Javascript_include_tag

2011-12-03 Thread Hemant Bhargava
parameter to it which can help me out? Thanks a lot in advance. - Hemant Bhargava -- 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-ta

[Rails] CalendarDateSelect Error:

2011-04-25 Thread Hemant Bhargava
Hello All, I guess you guys can light me up better than google. I am getting a pop-up when i introduced full_calendar functionality in my app. The pop-up message is:- CalendarDateSelect Error: Prototype could not be found. Please make sure that your application's layout includes prototype.js (.g.

[Rails] iso8601 format in date

2011-04-21 Thread Hemant Bhargava
Hello All, I need some explanation about iso8601 format. Googled it but did'nt found as i wanted. Actually, i have a table called abc, columns are idate (type date) and itime (type time). I concatenated them like this, date_time = self.idate + " " + self.time and passed it as a parameter to a f

[Rails] Re: Same file in different apps

2011-03-06 Thread Hemant Bhargava
Hemant Bhargava wrote in post #985888: > So rubians :), please help me on it. I think writing plugin is a fair > idea. Now, i thought of writing a plugin. So steps i done:- 1) Creates new rails app. 2) Creates plugin using ./script/generate plugin "NAME". This will create ne

[Rails] Same file in different apps

2011-03-06 Thread Hemant Bhargava
Well say if i need app/models/abc.rb of an existing application ABC into new application DEF, then what all i need to do? There are so many files i need to be shared but did'nt have any fair idea how to get it. So rubians :), please help me on it. I think writing plugin is a fair idea. -- Posted

[Rails] Re: Same file in different apps

2011-03-03 Thread Hemant Bhargava
Well say if i need app/models/abc.rb of an existing application ABC into new application DEF, then what all i need to do? There are so many files i need to be shared but did'nt have any fair idea how to get it. So rubians :), please help me on it. -- Posted via http://www.ruby-forum.com/. --

[Rails] Re: Changing variables on Left hand side.

2011-02-02 Thread Hemant Bhargava
Yups, I have used hash. That is much more clearer as well in code.:) Thanks. Frederick Cheung wrote in post #979078: > In this particular case you can use instance_variable_set. However i'd > usually not do this - I'd probably build up a hash instead. > > Fred -- Posted via http://www.ruby-foru

[Rails] Changing variables on Left hand side.

2011-02-01 Thread Hemant Bhargava
How do i take changing-variables on left hand side? I am trying it like this, but gives me an error that "expected end" at line no. 50. Abc.all.each do |a| "@some_array_#{a.name}" = do_something --line number 50 end Is there any way to achieve this? -- Posted via http://www.ruby-

[Rails] Re: Bantik-Seer Gem Usage

2011-01-28 Thread Hemant Bhargava
Am i the only one who uses this gem? @Chuck, where are you? :) -- 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 unsubsc

[Rails] Bantik-Seer Gem Usage

2011-01-27 Thread Hemant Bhargava
Hi All, Anyone used the Bantik-Seer gem to create Ruby graphs/charts? If so, i have some questions about usage. Thanks in advance. -- 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 th

[Rails] Jquery Prev is not working

2011-01-26 Thread Hemant Bhargava
Hi All, I have my source code as- --- ABCDEFGHI and then again image and a href(link) I try to find the next and prev element when i click on any link. So i have done it like this in JS file:- function showHide(elem) { v

[Rails] Re: Multiple Array Declarations.

2011-01-10 Thread Hemant Bhargava
I am sorry but i knew that as well. Is there any way to do it using foreach method. I mean like:- 1.upto 10 do { |i| "array#i" = [] } Sandip Ransing wrote in post #973867: > array1= array2... = array10 = [] > > On Tue, Jan 11, 2011 at 12:33 PM, Hemant Bhargava > w

[Rails] Multiple Array Declarations.

2011-01-10 Thread Hemant Bhargava
Hello Rubyites, Seems like this is a newbie question but want to get rid of it asap. Googled but found nothing. I have some arrays(10 arrays) which i am using in my code. Now declaraing/defining each/every array is redudant code as like array1, array2... array10 = [], [],...[] Is there any other

[Rails] Re: Urgent + Validations

2010-11-15 Thread Hemant Bhargava
Hello Fred, Thanks for a quickie. But did'nt quite get it. Is it something like this? validates_presence_of :abc_column, :on => :update, :if => some_method .. and then this method should be defined somewhere. def some_method if particular_param_is_present return true end return false

[Rails] Urgent + Validations

2010-11-14 Thread Hemant Bhargava
Hello, I am saving/updating same object on different pages with some validations. On first page, I save my object and on 2nd, 3rd, 4th pages i update the same object. So at first page i am using validates_inclusion_of :in => [] etc, and in second page(updating), i am using validates_presence_of :a

[Rails] Ajax request not coming

2010-10-05 Thread Hemant Bhargava
Hello guys, I am sending an ajax request in javascript with some parameters. Ajax request is javascript is written as:- new Ajax.Request( '/controllername/actionname?employee_id=' + employee_id + '&employee_name=' + emp_name + some_more_parameters, { asynchronous:true, evalScripts:true, onF

[Rails] Re: Same file in different apps

2010-10-05 Thread Hemant Bhargava
If i'll write an class/module and then share that class/module using require/whatever.. Will that work? Frederick Cheung wrote: > Your own plugin - you write one containing the code you want to share. > > Fred -- Posted via http://www.ruby-forum.com/. -- You received this message because y

[Rails] Re: Same file in different apps

2010-09-24 Thread Hemant Bhargava
Frederick Cheung wrote: > You can stick them in a plugin these days (rails 3 also has some > mountable apps stuff) > > Fred What plugings ? I am using rails 2.3.2.. Can you light me something.. :) -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscrib

[Rails] Same file in different apps

2010-09-24 Thread Hemant Bhargava
Hello Guys, Is there any way to use same file(model/controllers/views) between two different applications. If possible then how.. ? Thanks in advance. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"

[Rails] Re: Change databaase column

2010-09-21 Thread Hemant Bhargava
Hey colin, Thanks for your reply. It worked. Colin Law wrote: > On 21 September 2010 12:31, Hemant Bhargava > wrote: >> Guys, >> >> I have create this database column a while ago- >> t.date :interview_date, :null => false means that this column can not >>

[Rails] Change databaase column

2010-09-21 Thread Hemant Bhargava
Guys, I have create this database column a while ago- t.date :interview_date, :null => false means that this column can not have null value and then i deployed it on my server. Now i want this column to be changed as t.date :interview_date, :null => true so that my column can accept null values al

[Rails] Re: Re: Routes.rb

2010-08-17 Thread Hemant Bhargava
Colin Law wrote: > On 17 August 2010 14:48, Hemant Bhargava wrote: >> >> >> Hope you people got it right.. :) > > So are you asking the question is there a better way do define the > route for create_req rather than specifying it as you have above? I > do

[Rails] Re: Routes.rb

2010-08-17 Thread Hemant Bhargava
Ar Chron wrote: > Hemant Bhargava wrote: >> >> In routes.rb, to create and access a new page everytime i need to write >> :page_name => :any to my config/routes.rb. Ok. Here is the whole scenario for those who did'nt get it. I am using scaffolding type for resum

[Rails] Routes.rb

2010-08-17 Thread Hemant Bhargava
Hello All, In routes.rb, to create and access a new page everytime i need to write :page_name => :any to my config/routes.rb. Can you guys tell me any better alternative to this? Thanks in advance. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribe

[Rails] Javascript links not working in production mode.

2010-07-23 Thread Hemant Bhargava
Hello guys, I have some stupid kind of problem with me. Hope you guys can help me to get rid of it. The problem is that in javascript i am making ajax requests manually just by giving links. So when that function get called in javascipt ajax request will generate and perform the function. I given

[Rails] Re: Re: Re: Model Validations + Urgent

2010-07-23 Thread Hemant Bhargava
Colin Law wrote: > On 20 July 2010 14:54, Hemant Bhargava wrote: >>>> do it in models with validations. >>> >>> How are you checking the file attributes in the controller? >> >> Just like as >> if File.size(params[:upload_resume]) > 1mb

[Rails] Re: Re: Model Validations + Urgent

2010-07-20 Thread Hemant Bhargava
Colin Law wrote: > On 20 July 2010 14:32, Hemant Bhargava wrote: >> >> Hello Guys, >> Thanks for your replies. >> >> Yes i want to check the size of file before upload only. I mean first i >> am checking that file had valid attributes or not. If it has the

[Rails] Re: Model Validations + Urgent

2010-07-20 Thread Hemant Bhargava
Colin Law wrote: > On 20 July 2010 11:07, Hemant Bhargava wrote: >> Hello all, >> >> How to give validation on a field which is not a database column. I mean >> i am having a file field(upload_resume) in my views. So i want to give >> validation on it that size

[Rails] Re: Model Validations + Urgent

2010-07-20 Thread Hemant Bhargava
kannav rajeev wrote: > are you using any plug in for file field like attechment_fu or > paperclip . if yes please type No i am not using any thing. > > On Tue, Jul 20, 2010 at 3:37 PM, Hemant Bhargava > wrote: >> >> -- >> You received this message because

[Rails] Model Validations + Urgent

2010-07-20 Thread Hemant Bhargava
Hello all, How to give validation on a field which is not a database column. I mean i am having a file field(upload_resume) in my views. So i want to give validation on it that size should be less then 1mb. I tried self.upload_resume and params[:upload_resume] but both are not working. So guys, l

[Rails] Re: Email on error

2010-07-14 Thread Hemant Bhargava
Philip Hallstrom wrote: >> Is there any built in method/gem which can send an email when any kind >> of error comes in your application? > > There are. I'd suggest looking into hoptoadapp or exception notifier or > one of the other services that provide hooks for this sort of thing. > > Much mo

[Rails] Email on error

2010-07-14 Thread Hemant Bhargava
Hello All, Is there any built in method/gem which can send an email when any kind of error comes in your application? -- 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

[Rails] Re: Kind of object

2010-07-09 Thread Hemant Bhargava
I think instance_of can serve my purpose. Hemant Bhargava wrote: > Hello All, > > I want to know that is there anything in ruby by which i can know that > which kind of object is this..? Something like is_object? :) > > I mean.. lets suppose i have two objects of Model

[Rails] Kind of object

2010-07-09 Thread Hemant Bhargava
Hello All, I want to know that is there anything in ruby by which i can know that which kind of object is this..? Something like is_object? :) I mean.. lets suppose i have two objects of Model ABC and Model DEF.. then i want to execute some conditions based upon the type of objects. Thanks in ad

[Rails] Update file field..

2010-07-06 Thread Hemant Bhargava
Hello champs, I have uploaded a file and saved it in tmp/ location. But now i need to update this file field. I mean i need to replace that file with another file. While uploading, i used this:- @Resume = Resume.new(params[:resume]) .. This will call my model function upload_resume=() which will a

[Rails] Retaining file path

2010-07-02 Thread Hemant Bhargava
Hello All, I am submitting a page which consists of a file type input. So if i select file path after browsing and validation error comes out then all other info is chipped to the page but no file path. So can you guys light me into some direction that how to retain file path. Also, can i retain

[Rails] Re: Scaffolding

2010-07-02 Thread Hemant Bhargava
Sur Max wrote: > IMHO, you really need to study the routes and how restful routing > works. http://guides.rubyonrails.org/routing.html > Scaffolding must have had generated the restful routing for the said > controller and thus no other method except CRUD is being entertained > unless specified. >

[Rails] Scaffolding

2010-07-01 Thread Hemant Bhargava
Hello All, I am using scaffolding but i can not figure out that how to write my own methods except CRUD. I mean i know how to use CRUD methods but if i write my own method in my controller and call that from views then the request is going to show method. Ok.. the scenario is that have an method

[Rails] Chat software

2010-06-09 Thread Hemant Bhargava
Hello All, I want to create an chat software using ruby on rails. It would be just like gtalk only. I mean logged in users can see that who else are online and then they can talk to them. So can you guys tell me that from where can i start this. Tutorials, Examples, Plugins etc .. -- Posted via h

[Rails] Re: Re: File links in browser

2010-06-01 Thread Hemant Bhargava
Marnen Laibow-Koser wrote: > Hassan Schroeder wrote: >> On Mon, May 31, 2010 at 7:16 AM, Hemant Bhargava >> wrote: >> >>>>> Basically, if i open an txt file in firefox using "File > Open file" >>>>> then file is opening perfec

[Rails] Re: File links in browser

2010-05-31 Thread Hemant Bhargava
Hassan Schroeder wrote: > On Mon, May 31, 2010 at 6:07 AM, Hemant Bhargava > wrote: >> Basically, if i open an txt file in firefox using "File > Open file" >> then file is opening perfectly. But if i try to open a txt file from a >> file link on a webpage &q

[Rails] File links in browser

2010-05-31 Thread Hemant Bhargava
Basically, if i open an txt file in firefox using "File > Open file" then file is opening perfectly. But if i try to open a txt file from a file link on a webpage "file:///path" it is not going anywhere? Can i fix that in ROR ? If i can, then what is the way to get rid of this ? -- Posted via htt

[Rails] Re: Re: URGENT + production migrations

2010-05-27 Thread Hemant Bhargava
Andy Jeffries wrote: >>> Did you create new migrations or edit existing ones? >> >> I edited migrations on my local machine and checked in them.. :) Just >> now i realised that this could be the problem of me. > > It is indeed :-) Resolved it. Thanks to all of you with a big smile .. :) :) > >>

[Rails] Re: URGENT + production migrations

2010-05-27 Thread Hemant Bhargava
Andy Jeffries wrote: > > Have you changed database configuration in your database.yml? No. I have'nt changed. > > Are you getting any error messages (command line or in the log)? No i am not getting any error message at command line/log file. > > Did you create new migrations or edit existin

[Rails] URGENT + production migrations

2010-05-27 Thread Hemant Bhargava
Champs, I am in a great need of you people. My migrations are not running on production database. I done some changes in production mode and then i ran rake db:migrate RAILS_ENV=production / RAILS_ENV="production". But my database is not reflecting. Can you people tell me that what are the possibl

[Rails] Re: Test not passing at server

2010-05-26 Thread Hemant Bhargava
Frederick Cheung wrote: Yeah dude, I was doing it wrong only. Instead of specifying relative url in production.db, i specified that in environment.rb Anyhow resolved that.. Thanks Cheung > On May 26, 9:44�am, Hemant Bhargava wrote: >> Hello champs, >> >> I have a proble

[Rails] Test not passing at server

2010-05-26 Thread Hemant Bhargava
Hello champs, I have a problem that all of my test cases are passing on my local machine but many of them are not passing on server. Is this usually happens or i am doing anything wrong? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Goo

[Rails] Rails default date format

2010-05-14 Thread Hemant Bhargava
Hello All, How can i convert the date format "2010-01-01" to rails default date format. I mean to "Fri, 14 May 2010"? Is there any built in function for it.. Googled but ..? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "

[Rails] Missing templates problem in tests

2010-05-10 Thread Hemant Bhargava
Hello champs, I have been writing a functional test in which i create a new record and finds out that the record is porperly created or not. So i do it like this:- def test_should_create_record assert_difference('ABC.count') do post :method_name, :abc => { :name =>

[Rails] Re: Retain form data on redirection

2010-04-29 Thread Hemant Bhargava
Robert Walker wrote: > Hemant Bhargava wrote: >> Guyz, > Controllers typically do not redirect upon validation failures. If you > simply render the page again your form data will be available and the > Rails framework will kindly repopulate the form fields for you > autom

[Rails] Retain form data on redirection

2010-04-29 Thread Hemant Bhargava
Guyz, How to retain form data while redirecting back to same page? i do not want to work with sessions option. Any other way ..? I mean i am creating a record and after hitting submit button one of my validation failed and the form redirects to the same page where i have to fill the form values ag

[Rails] Re: How to pass model names?

2010-04-28 Thread Hemant Bhargava
Michael Pavling wrote: > def all_record_ids(model_name) > �all_records = model_name.constantize.all.find_all { > � �|record| record.status == "ACTIVE" > �} > end Thanks dude.. It worked like a charm.. i was not aware of this keyword.. :) -- Posted via http://www.ruby-forum.com/. -- You receiv

[Rails] How to pass model names?

2010-04-28 Thread Hemant Bhargava
How to pass model names? The scenario is that i have written a function in application_hepler.rb as like.. def all_record_ids(model_name) all_records = model_name.all.find_all { |record| record.status == "ACTIVE" } end I am calling this function as like [ all_record_ids("Employee") ] bu

[Rails] Re: Passing variables

2010-04-23 Thread Hemant Bhargava
Sharagoz wrote: > This is Prototype, not Rails, which is probably the reason for the > lack of responses. > The API is here: > http://www.prototypejs.org/api/ajax/options > > My guess is that you need to replace the comma with a plus operator > and prepend the second parameter with a & > > new Aj

[Rails] Re: Passing variables

2010-04-23 Thread Hemant Bhargava
Hemant Bhargava wrote: > Hello all, > But now both of the variables are not passing.. Can you guys give me > some light that what i am missing here .. ? Anyone listening me.. :) -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to t

[Rails] Passing variables

2010-04-22 Thread Hemant Bhargava
Hello all, I am trying to pass variables in Ajax.Request method. I can see that we can pass a single variable as:- new Ajax.Request('/controller/action?id=" + value + "&status=JOINING', {asynchronous:true, evalScripts:true, parameters:'resume[comment]=' + $F('resume_comment" + forward_value + "')}

[Rails] Unique by id

2010-04-16 Thread Hemant Bhargava
Guyz, tell me one thing that if i have an array of object of type ABC.. then how to find the objects from that array which are uniq in id.. I mean unique by ABC.id.. May be a newbie question.. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to t

[Rails] Re: Test downloading stuff

2010-04-16 Thread Hemant Bhargava
Balasubramaniam Muthaiah wrote: > @hemant what kind of crap question is this? be clear on your question Hey what i mean was is that i have an link to pdf file.. and when i click on it in firefox, it prompts me to download the file.. (Development phase) Now i want to write a test for it(Test pha

[Rails] Test downloading stuff

2010-04-16 Thread Hemant Bhargava
Guys, Anybody know how to test the downloading stuff .. ? -- 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-t...@googlegroups.com. To unsubscribe f

[Rails] Re: Testing partials

2010-04-13 Thread Hemant Bhargava
Hi Leonardo, I am not using any tool for tesing. Neither i want to.. Leonardo Mateo wrote: >> -- > In the same way you test your views. You can use Selenium if you like. > I don't like the use of Selenium for this, I prefer to test the views > contain the text that should be there and delegate t

[Rails] Testing partials

2010-04-13 Thread Hemant Bhargava
Guys, How can we test partials and layouts.. ? Googled but find nothing useful.. -- 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-t...@googlegroup

[Rails] Re: Validations problem

2010-04-09 Thread Hemant Bhargava
Anthony wrote: > it is impossible!! > Hey i know that is impossible.. That's why i am asking you people.. i have posted my migrations and validations here as well.. Can you please look at them and tell me .. -- Posted via http://www.ruby-forum.com/. -- You received this message because you ar

[Rails] Validations problem

2010-04-09 Thread Hemant Bhargava
Hello champs, I have a validation in model ABC and that is:- validates_presence_of :employee_id Now the record should not be saved without the presence of employee_id right. But now i wrote a test case like this:- def test_should_not_save_abcModel_without_employee_id abc = Abc.new(:name => "ABC

[Rails] Re: Newbie regular expression question..

2010-04-07 Thread Hemant Bhargava
AMILIN Aurélien wrote: > Le 07/04/2010 11:44, Hemant Bhargava a �crit : >> Hello champs, >> >> I am having an string and i want all extra characters to be removed from >> that string except + and . >> How to write a regular expression for it.. Currently i am t

[Rails] Re: Newbie regular expression question..

2010-04-07 Thread Hemant Bhargava
Siddick Ebramsha wrote: > Give sample input string and output string.. Hey thanks for such a quick reply.. Ok lets suppose, Input:- :hemant.bhargava...@gmail.com Output should be as only, hemant.bhargav...@gmail.com Means that i want to remove all extra chars except . and +.. Hope u got it now.

[Rails] Newbie regular expression question..

2010-04-07 Thread Hemant Bhargava
Hello champs, I am having an string and i want all extra characters to be removed from that string except + and . How to write a regular expression for it.. Currently i am trying it like this as word.sub(/[_-\:\\\/]/, "").. But its not working.. I can do it like this as well:- word.sub(/[\W]/, ""

[Rails] Re: Re: Re: Re: Ruby in javascript

2010-03-31 Thread Hemant Bhargava
Thanks colin and Rui.. I made it worked.. I copied the code from page source and give it to the onclick of the text box. Earlier also, i was donig the same but a variable was not there. So fixed it and worked like a charm.. Thanks again.. Colin Law wrote: > On 31 March 2010 09:04, Hem

[Rails] Re: Re: Re: Ruby in javascript

2010-03-31 Thread Hemant Bhargava
Colin Law wrote: > On 31 March 2010 06:43, Hemant Bhargava wrote: >> how should i do this in javascript.. I am little bit confused.. > I have not used calendar_date_select but I imagine it is already using > javascript to do the popup. Have a look at the html of your page and >

[Rails] Re: Re: Ruby in javascript

2010-03-30 Thread Hemant Bhargava
While using calendar_date_select, it appers like this .. i mean usage of this gem.. <%= calendar_date_select :abc, :def, :year_range => 1.years.ago..1.years.since %>, it come like this TEXT_BOX(nameabc[def]) Button After clicking on button a calendar popups and whatever date i select comes in

[Rails] Re: Ruby in javascript

2010-03-30 Thread Hemant Bhargava
Colin Law wrote: > Do you mean that within some javascript can you use Ruby? If you mean > that then this would be difficult. The ruby code is run in the server > which is where ruby is installed. Javascript is run in the users PC > in the browser. Hi Colin, only u come when i asks anybody for

[Rails] Ruby in javascript

2010-03-30 Thread Hemant Bhargava
Hey Champs.. Can we write some ruby code into javascript ? Can you guys light me? -- 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-t...@googlegro

[Rails] Re: How to open Pdf or doc file in firefox

2010-03-25 Thread Hemant Bhargava
Colin Law wrote: > On 25 March 2010 13:17, Hemant Bhargava wrote: >> � � � � � �:disposition => "inline") Hello colin, Thanks for a quick reply. But i do not want this to be happen in my firefox only. I want this to be happen in every application which are using my appli

[Rails] How to open Pdf or doc file in firefox

2010-03-25 Thread Hemant Bhargava
Hello champs, Currently i have given a link to my document as like:- '/controller/action/holidaylist.xls' and i have placed this file in my own created directory 'ABC' at RAILS_ROOT only. And in my controller, i have written like:- send_data(File.read("#{RAILS_ROOT}/ABC/" + file_name),

[Rails] Re: Testing tools in ROR ..

2010-03-22 Thread Hemant Bhargava
Hemant Bhargava wrote: > :) No i will write test myself only. I just want to know that how to > start writing test cases on a specific tool. > I mean can anyone give me the documentation or any available resource .. ? -- Posted via http://www.ruby-forum.com/. -- You received thi

[Rails] Re: Testing tools in ROR ..

2010-03-22 Thread Hemant Bhargava
:) No i will write test myself only. I just want to know that how to start writing test cases on a specific tool. Frederick Cheung wrote: > > Well there are a variety of additions or replacements to Test::Unit > (such as rspec, shoulda, rr, cucumber,mocha etc.) but they're not > going to write

[Rails] Testing tools in ROR ..

2010-03-22 Thread Hemant Bhargava
Hello champs, I have been using ROR from last 6 months so i do not have any too much ideas about writing test cases. Upto now i have been writing test cases manually .. i mean with assert_statements only.. But now i want to switch myself to testing tool.. ? Can any champs light me up with urls, b

[Rails] Call helper function in test file

2010-03-19 Thread Hemant Bhargava
Do anybody know how to call helper function in test files? I mean i have written a function in application_helper.rb and i want to call it in one of my test files.. test/integration/abc.rb .. Have any idea ? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are

[Rails] Re: Re: Some logic problem

2010-03-19 Thread Hemant Bhargava
Thanks colin. Resolved it as well. Cheers .. !! Colin Law wrote: > Remove it from the database and put in validations to stop it happening > again. > The infinite recursion could also be caused by an employee managing > himself. > > Colin -- Posted via http://www.ruby-forum.com/. -- You

[Rails] Re: Some logic problem

2010-03-18 Thread Hemant Bhargava
Hi josh, Thanks for a quickie, But how to get rid of this loop .. Josh Cheek wrote: > Perhaps you have a loop. > > EmployeeX manages EmployeeY and EmployeeY manages EmployeeX -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Grou

[Rails] Some logic problem

2010-03-18 Thread Hemant Bhargava
Hello champs, I am in dilemma here. I have structure like this:- EmployeeA | EmployeeBEmployeeC EmployeeD | | EmployeeE

[Rails] Re: Production Mode.. One liner question

2010-03-18 Thread Hemant Bhargava
Resolved.. We have to pass a RAILS_ENV variable at command line before ruby script/runner.. Cheers .. Xavier Noria wrote: > On Thu, Mar 18, 2010 at 1:00 PM, Hemant Bhargava > wrote: > >> Just a one liner question. I have written a script to put data into >> producti

[Rails] Production Mode.. One liner question

2010-03-18 Thread Hemant Bhargava
Hello Champs, Just a one liner question. I have written a script to put data into production database. Where to execute that script ? -- 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 t

[Rails] Re: Validations question

2010-03-05 Thread Hemant Bhargava
Andy Jeffries wrote: >> >> validate :start_date_should_not_be_greater_than_current_date >> > > Personally I'd rename that to: > > valid :start_date_before_now > > And then I'd do this as the method: > > def start_date_before_now > if start_date && start_date > Date.today > errors.add("Wha

[Rails] Validations question

2010-03-04 Thread Hemant Bhargava
I have wrote an validation function for checking that my starting date should be greater than the current date as like validate :start_date_should_not_be_greater_than_current_date def start_date_should_not_be_greater_than_current_date if self.start_date > Date.today errors.add("Whatever")

  1   2   3   >