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
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 ?
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
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
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
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
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
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 =
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
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
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
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
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
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
14 matches
Mail list logo