[Rails] rails 3 render xml irrespective of request.format

2011-01-18 Thread --- Z@m ---
I am trying to create an API and i need to return xml irrespective of the request format. now i have the following in my controller def index @posts = Post.all respond_to do |format| format.xml end end i have a index.xml.builder '/posts.xml' works for me but not '/posts' i tried request.format

[Rails] will the controller compiles the rjs only on ajax request ?

2009-04-28 Thread --- z...@m ---
will the controller compiles the rjs only on ajax request ? class xyzController . def ajax_req This works fine ajax_req.rjs is not compiled end def non_ajax_req non_ajax_req.rjs is not compiled end end Am i right or my code lacks something ?

[Rails] can we decrypt the cipher encrypted using Digest::SHA1.hexdigest

2009-04-21 Thread --- z...@m ---
what i have done is as follows password = Digest::SHA1.hexdigest(#{salt}:#{password}) pass1 = Digest::SHA1.hexdigest(#{salt}:asdfgh) pass2 = Digest::SHA1.hexdigest(#{salt}:asdfgh) pass3 = Digest::SHA1.hexdigest(#{salt}:qwerty) puts pass1==pass2 puts pass1==pass3 This works fine but i need to

[Rails] Re: can we decrypt the cipher encrypted using Digest::SHA1.hexdigest

2009-04-21 Thread z...@m
And using Digest::MD5 ?? can i encrypt --~--~-~--~~~---~--~~ 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

[Rails] Re: can we decrypt the cipher encrypted using Digest::SHA1.hexdigest

2009-04-21 Thread z...@m
Ok i think its time to reveal my need i was doin a login system in rails for the time being i didnt provide the password encryption and i thought it was simple as many reliable encryption algorithms are available every where every thing worked perfectly untill i started encrypting the password

[Rails] Re: How can i know weather a record is saved or not?

2009-03-06 Thread --- z...@m ---
record.save? will return Boolean. i just want to know weather it is saved ? i don want to save it or try to save it ! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this

[Rails] Re: How can i know weather a record is saved or not?

2009-03-06 Thread --- z...@m ---
You can do record.new_record? to check if it is a new record Thank you thats what i want ! --~--~-~--~~~---~--~~ 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

[Rails] how to give default value to fields in a model while creating model_name.new()

2009-03-05 Thread --- z...@m ---
am a newbie to rails , I created a model named Employee and in migration i added the following class CreateEmployee ActiveRecord::Migration def self.up create_table :employees do |t| t.string :name, :limit = 40, :null = false,:default = t.text :address, :limit =

[Rails] Re: how to give default value to fields in a model while creating model_name.new()

2009-03-05 Thread --- z...@m ---
yea am using mysql sad ! ! --~--~-~--~~~---~--~~ 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

[Rails] How can i know weather a record is saved or not?

2009-03-05 Thread --- z...@m ---
after creating a new record of a model , using new() is there any way to know weather an record is saved to dataabase of is it still in new state ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk

[Rails] managing multiple rails applications with apache

2009-03-01 Thread --- z...@m ---
how can manage multiple rails applications with apache i have followed the following tutorial and successfullt set up my rails site using apache http://www.howtoforge.com/ruby_on_rails_debian_etch http://www.howtoforge.com/ruby_on_rails_debian_etch_p2 but how can i configure apache to host

[Rails] what / when calls create function in an ActionController ?

2009-02-27 Thread --- z...@m ---
Hi friends , i am newbie and was trying to learn rails by following a tutorial which uses attachment_fu to upload videos .! every thing was working till i edited something somewhere ! the problem is that nothing happens when i click the submit button the new.html.erb is as follows and it

[Rails] Re: what / when calls create function in an ActionController ?

2009-02-27 Thread --- z...@m ---
i tried % form_for :advertisement, @advertisment, :url = { :action = create }, :html = { :multipart = true } do |f| % but the result is the same ! will on clicking the submit button automatically call the create function? how can i know weather it is called or not

[Rails] Re: what / when calls create function in an ActionController ?

2009-02-27 Thread --- z...@m ---
My routes.db ActionController::Routing::Routes.draw do |map| map.resources :advertisements map.root :controller = home map.connect ':controller/:action/:id' map.connect ':controller/:action/:id.:format' end --~--~-~--~~~---~--~~ You received this