[Rails] Browsing Image on Apache in rails App

2010-09-23 Thread Saurabh Peshkar
Hi All,

My rails application is running on Apache server with phusion_passenger
gem. For testing purpose I used both attachment_fu and paperclip to
upload image in that application. There are two different methods, one
for image uploading using attachment_fu and another for paperclip.

When the application starts in development mode, everything works as
expected but when it comes to production mode after browsing an image
and hit upload it crashes and throws "500 Internal Server Error".

First I thought that error was occuring due to plugins but i commented
the code in both of the methods and had written a single redirect_to
line in them but still the application is throwing the same error.

Both of the plugins are working fine upto image size 7.6kb but error is
shown if image size > 7.6kb. Image validations are upto 100 kb image.

Please guide me.

Thanks
Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Re: Re: Phusion Passenger error

2010-09-07 Thread Saurabh Peshkar
Colin Law wrote:
> On 7 September 2010 08:38, Saurabh Peshkar  wrote:
>>> be inside the public/system/
>>> tell me your deployment environment to see if i can help.
>>
>> Hi radhames,
>>
>> I am using attachment_fu for image uploading. Images are getting created
>> in public/pictures//0001/
> 
> Are you sure the message is coming from the upload and not from the
> action after the upload completes?  Check your code to see what you do
> after the upload  (is it attempting to show the picture, using the
> wrong path?)  and have a look in the log file to get more clues.
> 
> Colin

Hi Colin,

Error occurs when the upload_image method gets called, picture is not 
getting saved on server. It is not able to complete the upload request.

Thanks
Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Re: Phusion Passenger error

2010-09-07 Thread Saurabh Peshkar
radhames brito wrote:
> dont add a route for that, is in the public directory there is no need 
> for
> that, everything static is server by the web server no by rails so 
> creating
> a route in the route file makes no sense. Are you using capistrano and
> paperclip? in that case that is not the right path, capistrano updates 
> the
> sym links on every release so everything that needs to be persistent has 
> to
> be inside the public/system/
> tell me your deployment environment to see if i can help.

Hi radhames,

I am using attachment_fu for image uploading. Images are getting created 
in public/pictures//0001/

Thanks,

Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Phusion Passenger error

2010-09-06 Thread Saurabh Peshkar
Anubhaw Prakash wrote:
> Anubhaw Prakash wrote:
>> Saurabh Peshkar wrote:
>>> Hi All,
>>> 
>>> I am having an ROR application deployed on server, it is throwing the
>>> following error on server when user uploads an image:
>>> 
>>> ActionController::RoutingError (No route matches
>>> "/images/.png" with {:method=>:get})
>>> 
>>> Thanks
>>> 
>>> Saurabh
>> 
>> Hi Saurabh,
>> This error does not seem to be a passenger issue.
>> This is related to routes. Add proper route to environment.rb for 
> 
> 
> Add proper route to route.rb.
> 
> Thanks,
> Anubhaw

Hello Mr. Anubhaw Prakash,

I have tried it but still it is throwing the same error.

Thanks,

Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Phusion Passenger error

2010-09-06 Thread Saurabh Peshkar
Hi All,

I am having an ROR application deployed on server, it is throwing the
following error on server when user uploads an image:

ActionController::RoutingError (No route matches
"/images/.png" with {:method=>:get}):
passenger (2.2.15) lib/phusion_passenger/rack/request_handler.rb:92:in
`process_request'
  passenger (2.2.15)
lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
  passenger (2.2.15)
lib/phusion_passenger/railz/application_spawner.rb:441:in
`start_request_handler'
  passenger (2.2.15)
lib/phusion_passenger/railz/application_spawner.rb:381:in
`handle_spawn_application'
  passenger (2.2.15) lib/phusion_passenger/utils.rb:252:in `safe_fork'
  passenger (2.2.15)
lib/phusion_passenger/railz/application_spawner.rb:377:in
`handle_spawn_application'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in
`__send__'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in
`main_loop'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:196:in
`start_synchronously'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:163:in
`start'
  passenger (2.2.15)
lib/phusion_passenger/railz/application_spawner.rb:222:in `start'
  passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:253:in
`spawn_rails_application'
  passenger (2.2.15)
lib/phusion_passenger/abstract_server_collection.rb:126:in
`lookup_or_add'
  passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:247:in
`spawn_rails_application'
  passenger (2.2.15)
lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
  passenger (2.2.15)
lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
  passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:246:in
`spawn_rails_application'
  passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:145:in
`spawn_application'
  passenger (2.2.15) lib/phusion_passenger/spawn_manager.rb:278:in
`handle_spawn_application'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in
`__send__'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:352:in
`main_loop'
  passenger (2.2.15) lib/phusion_passenger/abstract_server.rb:196:in
`start_synchronously'

Note: I am using attachment_fu for image uploading.

Anyone is having any solution on this??

Thanks

Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Rack gem in not getting unpacked

2010-09-03 Thread Saurabh Peshkar
Saurabh Peshkar wrote:
> Hi All,
> 
> my server is having rack gems as:
> 
> rack (1.2.1, 1.1.0, 1.0.1, 1.0.0)
> 
> when i run the following command in my project/vendor/gems folder:
> 
> gem unpack rack-1.0.0
> 
> It shows the following error message:
> 
> Error: Gem 'rack-1.0.0' not installed.
> 
> Any idea on this??
> 
> Thanks,
> 
> Saurabh

Query solved, used following command:

gem unpack rack -v=1.0.0
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Rack gem in not getting unpacked

2010-09-03 Thread Saurabh Peshkar
Hi All,

my server is having rack gems as:

rack (1.2.1, 1.1.0, 1.0.1, 1.0.0)

when i run the following command in my project/vendor/gems folder:

gem unpack rack-1.0.0

It shows the following error message:

Error: Gem 'rack-1.0.0' not installed.

Any idea on this??

Thanks,

Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Sending Emails to Inbox

2010-08-26 Thread Saurabh Peshkar
clanlaw wrote:
> On 26 August 2010 07:52, Saurabh Peshkar  wrote:
>> Hi All,
>>
>> I am having a functionality of sending emails in my rails application.
>> Sending the emails is working properly but sometimes the email goes to
>> Inbox folder and sometime it goes to Spam folder. I am sending one email
>> at a time, there is no bulk/mass emails.
>>
>> Does anyone have any idea regarding how to send email to Inbox??
> 
> Whether it goes to the inbox or the spam folder is up to the email
> receiving application.  If it thinks it is spam then there is nothing
> you can do about it other than change your email to make it less
> spammy.  I assume that you have made sure you are putting sensible
> data in all the headers.
> 
> Colin

Hi Colin,

Will you please elaborate on how to make emails less spammy and what is 
sensible data for an email? If you are having any reference url please 
send me.

Thanks for help

Regards
Saurabh

-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Sending Emails to Inbox

2010-08-25 Thread Saurabh Peshkar
Hi All,

I am having a functionality of sending emails in my rails application.
Sending the emails is working properly but sometimes the email goes to
Inbox folder and sometime it goes to Spam folder. I am sending one email
at a time, there is no bulk/mass emails.

Does anyone have any idea regarding how to send email to Inbox??

Any help appreciated.

Thanks
Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Pass hash prameters in routes

2010-07-23 Thread Saurabh Peshkar
Hi All,

Query:

I am having a link as

<%= link_to "link_name", :controller => "some_controller", :action =>
"some_action", :id => "some_id", :first_param => {:second_param => "some
value"} %>

and in my routes.rb

map.connect '/some_name/:id' :controller => "some_controller", :action
=> "some_action"

Above code is giving me an url as

http://localhost:3000/some_name/some_id

my requirement is to construct the url as:

http://localhost:3000/some_name/some_id/

Please help me out.

Thanks,

Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] bad content body on MC FF

2010-07-21 Thread Saurabh Peshkar
Hi All,

I'm getting the following error in my production.log when I try to
upload a file from MAC FF. On rest of the browsers file uploading is
working fine.

Rendering
/home5/folder_namete/Portfolio/application_name/public/404.html (404 Not
Found)
/!\ FAILSAFE /!\  Wed Jul 21 07:55:45 -0600 2010
  Status: 500 Internal Server Error
  bad content body
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/utils.rb:351:in
`parse_multipart'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/utils.rb:323:in
`loop'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/utils.rb:323:in
`parse_multipart'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/request.rb:133:in
`POST'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb:15:in
`call'

/home5/folder_namete/Portfolio/application_name/vendor/rails/actionpack/lib/action_controller/params_parser.rb:15:in
`call'

/home5/folder_namete/Portfolio/application_name/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb:93:in
`call'

/home5/folder_namete/Portfolio/application_name/vendor/rails/actionpack/lib/action_controller/failsafe.rb:26:in
`call'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in
`call'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in
`synchronize'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in
`call'

/home5/folder_namete/Portfolio/application_name/vendor/rails/actionpack/lib/action_controller/dispatcher.rb:106:in
`call'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/content_length.rb:13:in
`call'
/usr/lib64/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/fastcgi.rb:58:in
`serve'

/home5/folder_namete/Portfolio/application_name/vendor/rails/railties/lib/fcgi_handler.rb:103:in
`process_request'

/home5/folder_namete/Portfolio/application_name/vendor/rails/railties/lib/fcgi_handler.rb:153:in
`with_signal_handler'

/home5/folder_namete/Portfolio/application_name/vendor/rails/railties/lib/fcgi_handler.rb:101:in
`process_request'

/home5/folder_namete/Portfolio/application_name/vendor/rails/railties/lib/fcgi_handler.rb:78:in
`process_each_request'
/usr/lib64/ruby/gems/1.8/gems/fcgi-0.8.8/lib/fcgi.rb:117:in
`session'
/usr/lib64/ruby/gems/1.8/gems/fcgi-0.8.8/lib/fcgi.rb:104:in
`each_request'
/usr/lib64/ruby/gems/1.8/gems/fcgi-0.8.8/lib/fcgi.rb:36:in `each'

/home5/folder_namete/Portfolio/application_name/vendor/rails/railties/lib/fcgi_handler.rb:77:in
`process_each_request'

/home5/folder_namete/Portfolio/application_name/vendor/rails/railties/lib/fcgi_handler.rb:76:in
`catch'

/home5/folder_namete/Portfolio/application_name/vendor/rails/railties/lib/fcgi_handler.rb:76:in
`process_each_request'

/home5/folder_namete/Portfolio/application_name/vendor/rails/railties/lib/fcgi_handler.rb:51:in
`process!'

/home5/folder_namete/Portfolio/application_name/vendor/rails/railties/lib/fcgi_handler.rb:23:in
`process!'
dispatch.fcgi:24

Any idea??

Thanks,

Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: <%=h...%>

2010-07-20 Thread Saurabh Peshkar
Abder-Rahman Ali wrote:
> In the "Head First Rails" book, it mentions that "h" in <%=h...%> is a
> helper method.
> 
> Can someone describe what that means? And, when should I use <%=h...%>?
> Is it when I want the result to be displayed on my view for example?
> 
> Thanks.

Hi,

I know the use of <%=h...%> is to show the html tags:

Consider the following example:

@a= "hi how are you."

<%= @a %>
#=> hi how are
you.

<%=h @a %>
#=> hi how are you.

Regards,

Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: check pluralization

2010-07-12 Thread Saurabh Peshkar
David Zhu wrote:
>> Is there a command you can write in the terminal that returns a plural
>> version of a word that rails uses?
> 
> 'mouse'.pluralize

Hi,

If the above doesn't seems to work, try the following:

in console:
$] irb
> require 'activesupport'
> 'mouse'.pluralize

Regards,

Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: migrate problem

2010-06-25 Thread Saurabh Peshkar
Hi  pravin,

Please check the spelling of "database" on line 4 and coln 11

Might Help.

Regards,

Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: how to pass params to button_to_remote ?

2010-06-18 Thread Saurabh Peshkar
Mamadou Touré wrote:
> Hi folks,
> 
> I have a form that I populate, and then submit with button_to_remote,
> but I would like to have all my fileds that I populated passed as
> parameters (like the params hash) with to my controller. How would you
> do that ?
> 
> Reagrds

Hi,

button_to_remote is having following syntax:

<%= button_to_remote "", :url => {:controller => 
"", :action => "", :id => , 
:paramterers => ""}, :html => {:style => "", :class => 
""} %>

If you are trying to submit a form using ajax call, you can try for 
form_remote_tag

Might Help,

Saurabh.
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Multiple classes on form text_field

2010-06-16 Thread Saurabh Peshkar
Hi Ralph,

Have you tried this:

<%= f.text_field :x, :class => 's t' %>

Regards,

Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: options_for_select error

2010-06-10 Thread Saurabh Peshkar
Hi Anjali,

Try using brace brackets.

<%= select_tag :list_filter, options_for_select({"All" =>
"all", "Top Contribution" => "top_contributors", "Top Questioners" =>
"top_questioners", "Top High Quality General Purpose Experts" =>
"general_experts", "Most Influential" => "most_networked", "Most
decorated" => "most_decorated", "Most commonly sought after experts" =>
"most_sought", "Best All round Experts" => "experts"}) %>


Might Help.

Regards,

Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Showing youtube video

2010-06-10 Thread Saurabh Peshkar
Tushar Gandhi wrote:
> Hi,
> I have one problem. How can I get the video thumbnails like what we will 
> see on youtube on right side?
> Thanks,
> Tushar
> Tushar Gandhi wrote:
>> Thanks Saurabh.
>> It is working fine.

Hi Tushar,

I have tried something like this:

if the youtube url is like 
http://www.youtube.com/v/sM-wckCGIEE&hl=en_US&fs=1&; then split the code 
between v/ and &hl i.e try to fetch sM-wckCGIEE from above url
then paste it in http://i4.ytimg.com/vi/sM-wckCGIEE/default.jpg you will 
get the thumb image.

No idea how to show time.

Regards

Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Showing youtube video

2010-06-09 Thread Saurabh Peshkar
Tushar Gandhi wrote:
> Hi,
> I want to build an functionality by which user will add the youtube
> video link into my app. After that he/she should be able to see the
> video in my application.
> Like in facebook you can add the video link and that video will be shown
> into facebook with the video's image and name.
> 
> Can anyone tell me how to do this?
> Is there any plugin/gem avaliable for this?
> 
> 
> Thanks,
> Tushar

Hi Tushar,

Have to tried this:

http://www.youtube.com/v/sM-wckCGIEE&hl=en_US&fs=1&}";>http://www.youtube.com/v/sM-wckCGIEE&hl=en_US&fs=1&}"; 
type="application/x-shockwave-flash" allowscriptaccess="always" 
allowfullscreen="true" width="480" height="385">

Might Help.

Ragards,

Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: To Display save button , when we select an option from drop

2010-06-09 Thread Saurabh Peshkar
Venu Gopal wrote:
> Hi
> 
>I need help regarding displaying of a save button when we select some
> thing from the drop down.

Hi,

Try using the following

<%= select_tag "name", options_for_select(["Free", "Basic", "Advanced", 
"Super Platinum"], "Free"), {:onchange => "call a javascript function 
that will show the save button"} %>

Might Help.

Regards

Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: check_box_tag problems

2010-06-09 Thread Saurabh Peshkar
Hi,

Are you trying to apply a loop on cats hash??

If yes then try this:

@var1 = []
params[:cats].each do |key, value|
  @var1 << key
end

if @var1.include?(your_key)
  do this
else
  do that
end

Regards,

Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Rails crashes when running more than 1 instance..

2010-06-08 Thread Saurabh Peshkar
Hi Tim,

If you are using Fedora try following command in terminal:

console$> ps -fu

USER   PID %CPU %MEMVSZ   RSS TTY  STAT START   TIME COMMAND
user   3429  0.0  0.0   5072  1672 pts/1Ss   Jun08   0:00 bash
user  15217  2.0  0.0   4628   908 pts/1R+   03:17   0:00  \_ ps -fu
user   3355  0.0  0.0   5072  1340 pts/0Ss   Jun08   0:00 bash
user   3412  0.0  2.0  73600 42684 pts/0Sl+  Jun08   0:20  \_ ruby 
script

console$> kill -9 3412 (PID for ruby script/server)

Might Help!

Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] HTML tag checker

2010-05-07 Thread Saurabh Peshkar
Hi All,

I'm having a text area in my rails application as <%= f.text_area :text
%>. User allowed to enter HTML tags in that text area. I'm facing
following problems:

1) Not able to check whether the HTML tags entered by user are correct
or not i.e how to check whether the HTML tags are properly closed or not
(<>).

2) If the user copies the source code of any site and pastes it into
above text field, the layout distracts.

Suggestions Appreciated

Thanks and Regards

Saurabh Peshkar
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Rails System Commad

2010-02-09 Thread Saurabh Peshkar
Hi Marnen,

I am trying to determine whether the system command which I had run is 
running properly on the console or not, through ruby code.

Thanks,
Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Rails System Commad

2010-02-09 Thread Saurabh Peshkar
Hi All,

I'm having the following scenario:

In my code i run the rails system command

system "say xyz"

Suppose this "say xyz" command runs a process for a very long period of
time then I want to:

1) stop/kill that process through rails code on click of button.
2) can I determine whether the system command is running properly and
not had hanged the system?

Please guide me.

Thanks in advance,

Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Parallel Payment Conflict Resolution in Paypal

2010-02-07 Thread Saurabh Peshkar
I want to use the paypal adaptive parallel payment API with ROR, please
help me out regarding the following query.

Query:

Suppose there is a Buyer say B1 bought products, of different sellers
say S1, S2, S3, from http://mysite.com. Some part of money will go to
site administrator say A1. If any of the seller is faulty i.e. if S2
does not deliver the item and B1 claims for Dispute Resolution then:

1) only sellers are claimed for the same or admin is also needed to pay
the penalty.
2) how will site administrator handles it.

Thanks and Regards

Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.



[Rails] Re: Cross Browser Check

2009-12-28 Thread Saurabh Peshkar
Hi Maren,

I'm trying to get a total hit count on example2.com.

Thanks
Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.




[Rails] Cross Browser Check

2009-12-27 Thread Saurabh Peshkar
Hi All,

I'm having the following query:

My site is http://www.example1.com and there is another site
http://www.example2.com (not mine), can I keep a track of how many
people visited http://www.example2.com as there is no relation between
these two sites.

Thanks in advance,
Saurabh
-- 
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 from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.




[Rails] Re: Unwanted call to validates_associated

2009-10-28 Thread Saurabh Peshkar

Max Williams wrote:
> Thanks, but that's a workaround, and a rather complex one at that.  I'd 
> rather understand why this is happening.

Hi Max,

I'm a newbie, not having much idea, still learning, So i used that 
workaround.

Regards
Saurabh
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Unwanted call to validates_associated

2009-10-28 Thread Saurabh Peshkar

Max Williams wrote:
> Hi Saurabh
> 
> Yes, it does seem that the "Answers is not valid" error message is 
> default, in the sense that nothing that i am doing is causing it, and 
> i'd like to remove it as you say.  The fact that the error message is 
> identical to what i would get from "validates_associated :answers" makes 
> me think it's something to do with that but i may be wrong.
> 
> The weird thing is that i don't usually get this in my other classes 
> that have has_many associations.  I also don't get it in this class for 
> the association with assets, which is also has_many.  For example. if i 
> invalidate an associated asset, or an associated question_asset (which 
> is the join between question and assets) then the question doesn't mind, 
> and is still valid.
> 
> So, it seems like a deviation from the normal behaviour.

Hi Max,

Have you tried the following in your model:

def after_validation
# Skip errors that won't be useful to the end user
filtered_errors = self.errors.reject{ |err| %w{ model name 
}.include?(err.first) }
self.errors.clear
filtered_errors.each { |err| self.errors.add(*err) }
  end

Hope this help.

Regards
Saurabh
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Unwanted call to validates_associated

2009-10-27 Thread Saurabh Peshkar

Max Williams wrote:
> In my schema, a question has_many :answers.  When the validations are
> run on a question, and one of the answers is not valid, then i get
> 
> "Answers is not valid"
> 
> coming out of errors.full_messages.  I don't want this, i'm already
> testing the validity of the answers and this is an ugly and
> uninformative error message.  It looks like it's the message i would get
> back if i was calling
> 
> validates_associated :answers
> 
> but i'm not, and if i *do* add this line
> 
>   validates_associated :answers, :message => "are not all valid"
> 
> then i get "Answers are not all valid" AND "Answers is not valid".  So,
> i guess it's coming from somewhere else.  But i can't work out where.
> With logging all i can see is that it happens during validation, and it
> happens *before* any other custom validations that i specify.  Ie,
> whatever is doing this seems to be doing it as the first step of the
> validation sequence.  If i take out all of my validations then it still
> occurs.  After doing that, the only reference to answers in the whole
> class is the association:
> 
>   has_many :answers, :class_name => "MillionaireAnswer", :order =>
> "position", :dependent => :destroy
> 
> The answers don't add any errors to their parent question when they are
> validated, and there's nothing going on in the controller to shove
> anything else in there.  I could do something horrible and hacky and
> remove it from the error messages before showing them on the page but
> i'd rather understand what's going on.
> 
> Anyone got any ideas?  max
> In case it's relevant here's my classes for questions and answers.

Hi Max,

the scenario is that you are getting two error messages, one is
generated (Answers are not all valid) and other one is default (Answers
is not valid), and you are trying to remove the error message generated
by default.

Please correct me if I am wrong.

Thanks
Saurabh
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Handling id for social networking site

2009-10-27 Thread Saurabh Peshkar

Thanks Max,

Do you have any idea about url hiding

Example:

My current url: http://localhost:3000/users/buying_history

I want to display it as http://localhost:3000/# or uneditable


Thanks
Saurabh
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Handling id for social networking site

2009-10-27 Thread Saurabh Peshkar

Hi All,

I want to handle the id parameter for social networking site

For example:

If the user logins to the site having id=1, he can show his profile as

http://localhost:3000/users/1
http://localhost:3000/users/1/edit for editing

Scenario is that the logged in user having id=1 is able to see the and
edit the profile details of another user say id=2 just by changing the
url.

http://localhost:3000/users/2
http://localhost:3000/users/2/edit for editing

Continuing the same user having id=1 is also be able to copy and paste
any url of user id=2 but some urls can only be accessed by user id=2

Problem:
One user must not able to access another user details, Please let me
know how to handle url parameters.

Thanks in advance,
Saurabh
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Paypal issue

2009-10-07 Thread Saurabh Peshkar

Hi All,

Modifying the above query, I want to make mass payment in paypal using 
rails, can i integrate paypal for mass payment.

Thanks

Saurabh
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Paypal issue

2009-10-07 Thread Saurabh Peshkar

Hi All,

I'm using paypal for transaction in my site, it is working properly for
the scenario of sending money from one person to another person but if I
want to send money from one person to multiple persons with multiple
amounts using paypal and rails how can I achieve it??


Thanks in advance,

Saurabh
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: audio/video file read

2009-10-07 Thread Saurabh Peshkar

Brijesh Shah wrote:
> Checkout this links
> 
> http://raa.ruby-lang.org/project/ruby-audiofile/
> http://ruby-audiofile.sourceforge.net/
> 
> I think this will help u...
> 
> Thanks
> Brijesh Shah

Hi Brijesh

Thanks for the links

I had gone through them, but ruby extconf.rb is throwing an error, do 
you have any idea about this:

checking for afOpenFile() in -laudiofile... no
*** ERROR: need to have all of this to compile this module
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
  --with-opt-dir
  --without-opt-dir
  --with-opt-include
  --without-opt-include=${opt-dir}/include
  --with-opt-lib
  --without-opt-lib=${opt-dir}/lib
  --with-make-prog
  --without-make-prog
  --srcdir=.
  --curdir
  --ruby=/usr/bin/ruby
  --with-audiofile-dir
  --without-audiofile-dir
  --with-audiofile-include
  --without-audiofile-include=${audiofile-dir}/include
  --with-audiofile-lib
  --without-audiofile-lib=${audiofile-dir}/lib
  --with-audiofilelib
  --without-audiofilelib


thanks,

Saurabh
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: audio/video file read

2009-10-07 Thread Saurabh Peshkar

Leonardo Mateo wrote:
> On Wed, Oct 7, 2009 at 11:19 AM, Saurabh Peshkar
>  wrote:
>>>
>>
> What have you found/tried so far?
> 
> --
> Leonardo Mateo.
> There's no place like ~

I use the File class, which had given me time(@file.atime) and 
size(@file.size)
but not getting the audio/video properties(e.g duration, sampling rate.. 
) as such.

Thanks

Saurabh
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: audio/video file read

2009-10-07 Thread Saurabh Peshkar

Frederick Cheung wrote:
> On Oct 7, 9:25�am, Saurabh Peshkar 
> wrote:
>> Hi All,
>>
>> I want to read an audio/video file using rails.
>>
>> please suggest me how can i achieve it!!
>>
> 
> Well at a basic level File.read will read the bytes from any file, but
> I rather suspect that isn't the answer you are looking for. What do
> you want to do with these files ?
> 
> Fred

Hi Fred,

I want to read the file size, it's duration, dimensions, codec and other 
such properties.

Thanks

Saurabh
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] audio/video file read

2009-10-07 Thread Saurabh Peshkar

Hi All,

I want to read an audio/video file using rails.

please suggest me how can i achieve it!!


Thanks,

Saurabh
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Auto print???

2009-10-04 Thread Saurabh Peshkar

Hi All,

I'm working on online food ordering system, as the order is created an
email is sent to the restaurant regarding the order, Is there any way to
inform the restaurant using auto printout or a fax.

Thanks in advance,

Saurabh
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: Accessing the instance variable in another method

2009-09-22 Thread Saurabh Peshkar

Subashini Kumar wrote:
> Hi,
> I am new to Rails.I tried developing a basic quiz application.Please
> help me out in my doubt.Thanks in advance
> 
> <% CODE %>
> 
> class QuizController < ApplicationController
> 
>   def index
> # i have retrieved the first five questions from the database for
> displaying the #question to user
> @quiz=Quiz.find(:all,:limit=>5)
> 
>   end
> 
>   def report
> 
>   end
> 
> # this method checks the answer and gives score
>   def checkanswer
> # here i want to access the @quiz object which is a set of questions i
> have #retreived from the database.Hot to access it?
>   end


> 
>   end

hi Subashini,

I think you can use @quiz variable by making it a class variable as 
@@quiz or a global variable $quiz.

might help,

Saurabh
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Saurabh Peshkar

Please correct me if I'm wrong

method after_validation collects all the error messages of club model 
and rejects the first error message, which is "club is invalid" and 
collects the remaining messages into variable and adds them to the error 
list.

Saurabh


-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Saurabh Peshkar

try this out,

in user.rb

  def after_validation
variable = self.errors.reject{ |err| %w{club }.include?(err.first) }
self.errors.clear
variable.each { |err| self.errors.add(*err) }
  end

might work.
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Saurabh Peshkar

Preksha Patel wrote:
> Saurabh Peshkar wrote:
>> what message you get, if you remove :message => nil after 
>> validates_associate :club
> 
> if i remove :message => nil then i get the message "club is invalid"

I'm not getting what exact message you want?
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Saurabh Peshkar

what message you get, if you remove :message => nil after 
validates_associate :club
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Saurabh Peshkar

Is the code working properly?
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Saurabh Peshkar

Have you commented the line

in club.rb
validates_associated :user
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Saurabh Peshkar

Preksha Patel wrote:
> Saurabh Peshkar wrote:
>> Have you written
>> 
>> in user.rb
>> 
>>  has_one :club
>> 
>> Saurabh
> 
> yes because there is one-to-one relationship between this two model and 
> user_id is foreign key in club table..

in your shared user.rb, I hadn't seen that line hence I asked 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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Saurabh Peshkar

Have you written

in user.rb

 has_one :club

Saurabh
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: model validations failed..(as there are two model used)

2009-09-15 Thread Saurabh Peshkar

Can you share your model?
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: model validations failed..(as there are two model used)

2009-09-14 Thread Saurabh Peshkar

Then try this,

in users_controllers.rb

def create
 @user = User.new(params[:user])
 @club = @user.build_club(params[:club])

 if @user.valid?
  @user.save
 end

end

Note: it is not required to specify @club.save because '.build' will 
automatically do that for you.

in model/user.rb
validates_associated :club

Saurabh
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: model validations failed..(as there are two model used)

2009-09-14 Thread Saurabh Peshkar

>  hi Saurabh
> 
> but i don't need to write @user.save any where?
> 
> 
>> 
>> This will check if both are valid or not and save them at same time, if 
>> any one of them is invalid nothing gets saved.
>> 
>> Saurabh.

Please let me know which controller are you trying to use? (Uses or 
Clubs)
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: model validations failed..(as there are two model used)

2009-09-14 Thread Saurabh Peshkar

> hi Saurabh
> 
> there is one-to-one relationship between club and user..
> and in club model i have used both
> validates_associated :user
> validates_presence_of :user_id, :message => nil
> then also it is not working..
> 
> and in view page i already specified error_messages_for..

Ok,

Try this,

def create
 @club = Club.new(params[:club])
 @user = @club.build_user(params[:user])

 if @club.valid?
  @club.save
 end

end

This will check if both are valid or not and save them at same time, if 
any one of them is invalid nothing gets saved.

Saurabh.
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Re: model validations failed..(as there are two model used)

2009-09-14 Thread Saurabh Peshkar

Hi Preksha,

Are you using '.build' parameters.

(e.g. @club = Club.new
@user = @club.users.build(params[:user]) for one(club) to many(users) 
relations)

and in view page

specify <%= error_messages_for :club, :user%>

Hope this might help.

Saurabh
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Integrate moneybookers

2009-09-14 Thread Saurabh Peshkar

Hi All,

I'm facing a problem with moneybookers api integration, I used the
sample HTML application generated by moneybookers api and specified the
return_url variable as my localhost:3000, but not getting how to collect
the response variables i.e. my transaction was successful or not, in my
rails application. Please tell me how to collect the response variable
from moneybookers using rails.

I used http://www.moneybookers.com/app/test_payment.pl url for HTML
generation


Thanks in advance,

Saurabh
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Mechanize gem

2009-05-30 Thread Saurabh Peshkar

Hi All,

I am trying to use Mechanize gem for some url, I am submitting the form
in that url but on the following submit command I got an error message.

command: page = agent.submit(search_form)

error: Iconv::InvalidEncoding
invalid encoding ("ISO-8859-1;", "UTF-8")



Please help me out,

Thanks in advance,
Saurabh
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Watir without -jssh extension

2009-05-28 Thread Saurabh Peshkar

Hi All,

Is there any way to run watir/firewatir without having -jssh extension
for firefox???

If so plz suggest me.

Thanks in advance,
Saurabh
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Watir Problem

2009-05-15 Thread Saurabh Peshkar

Hi All,

I had written a program to open a url and fill the textfields in that
site automatically. I used Watir to open url and fill the textfields. I
had given a link on view page, when someone clicks on it, desired url
opens and textfields gets filled. I run the program on comp1 and its
getting executed properly.

My problem is, when I click the same link from another computer say
comp2, it executes but the result is seen on comp1, i.e the url opens
and textfields fill on comp1 not on comp2.


Help me out!!

Thanks
Saurabh
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Identify dynamic name using Scrubyt

2009-05-12 Thread Saurabh Peshkar

Hi All,

I'm trying to execute the following code.

url = "https://xxx.com";(some url)
ebay_data = Scrubyt::Extractor.define :agent => :firefox  do
 fetch(url)
 fill_textfield field name, value
 record "//tab...@id='header']" do
   name "//inp...@class='req']"
 end
end

Code executes properly for static name of textfield

But the url which i'm trying to fetch is having dynamic name so when i
try to run the code it gives me error:

  Unable to locate element, using :name, ""
(Watir::Exception::UnknownObjectException)

Every time the name changes on refresh. Please suggest me how should I
fill the text field of a url with dynamic text_field name. (Using
Scrubyt)

Thanks
Saurabh
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---



[Rails] Another Database Connectivity

2009-04-06 Thread Saurabh Peshkar

Hi All,

I'm trying to connect another database using rails

I made changes in database.yml file

I succeed in that but with same table name,

I'm having two issues regarding that:

1) How to connect the specific table of another database (suppose table
name is Arthur and it is in database2, I'm working in database1)

2) How to connect database without making changes in database.yml file.


Any feedback appreciated,
Thanks
Saurabh
-- 
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 unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~--~~~~--~~--~--~---