[Rails] after_destroy callback order in Rails3.1.3

2012-01-24 Thread Charanya Nagarajan
I am using PostgreSql as database and Rails 3.1.3 and ruby 1.9.3 I have 3 models. - Activity - ActivityObject - ActivityObjectActivity They are related this way. **Activity** > has_many :activity_object_activities,:dependent => :destroy > has_many :activity_objects, :through => :activity_obj

[Rails] Action Mailer - Proxy Settings.

2011-03-21 Thread Charanya Nagarajan
Hi, I am developing a rails app on a system which connects to internet through proxy. I am facing difficulties while Action Mailer tries to send mails. It says, Time Out Error. But when I try to run the code in the system which is directly connected to internet without proxy, The mails are sent co

[Rails] Getting Information about users viewing the page.

2010-11-01 Thread Charanya Nagarajan
Hi All, I would like to implement a feature like, I Would like to know which all users are currently viewing a page in my Rails Application at any given instant. I use Restful Authentication plugin for User Authentication. Any Suggestions regarding how I can proceed on this ,would be really helpf

[Rails] Custom Layout Folder

2010-08-25 Thread Charanya Nagarajan
Hi all, I have a need to have another folder called custom-layouts which would have some of the layout files. My doubt is that,is it possible to have a folder like this and configure rails to look into this custom folder for layouts as we do for adding custom plugin paths in environment.rb. Any

[Rails] Rating Plugin

2010-06-20 Thread Charanya Nagarajan
Hi, I wanna rate an object on multiple criteria Like.. Benefits Applicability etc.. So i would want the user to rate an object on 2 criteria. Is there any plugin which will suit my need.Acts_as_rateable allows only rating on a single context.. Thanks In Advance.. Charanya Nagarajan -- Posted

[Rails] DatePicker in Lightbox

2010-05-22 Thread Charanya Nagarajan
Hi all... I use unobtrusive_date_picker plugin for getting date inputs. It works perfectly fine in a form on a normal page.But when I use the same on the lighbox window,the date_picker doesn work. Kindly help me in resolving this...I am not able to find why this is happenin.. I use Facebox javas

[Rails] Re: Secuiyrt issue in App

2010-04-05 Thread Charanya Nagarajan
use <%= h @user.information %> This will escape angle brackets and therefore neutralize any embedded JavaScript ushar Gandhi wrote: > Hi, > I am facing a following problem:- > I have app in which user can edit his/her personal information and we > are showing it on browser. Some of users has add

[Rails] Re: Help needed on Select Form

2010-04-05 Thread Charanya Nagarajan
os in the controller. Regards, Charanya Nagarajan Deb Liew wrote: > Hi, > > Thank you for your reply. > > Can I assume the method you stated is used when the values are inside > the database? Or does it work the same if it is not? > > Thanks, once again. > > Ch

[Rails] Re: Help needed on Select Form

2010-04-03 Thread Charanya Nagarajan
Deb Liew wrote: > Dear all, > > I am pretty new to ruby on rails and I am supposed to create a form with > a few drop down options. The first drop down option will affect the > result in the data appearing in the drop down option for the second > field. E.g. If user select mobile phone as their de

[Rails] Belongs_to and has_many

2010-02-11 Thread Charanya Nagarajan
Hi all I have a model called,article which belongs_to user so in article.rb belongs_to :user and in user.rb has_many :posts, :dependent => :nullify, :class_name => 'Article' so now @user.posts is giving the posts of the user Now like,without using any named_scope, i would want @user.posts to g

[Rails] Toggling effect

2010-02-02 Thread Charanya Nagarajan
Hi all, I have a list of links in a page,i have toggling effect associated with them <%= link_to_function("#{article.title}", nil ) do |page| page.visual_effect :toggle_blind, "article_content_#{article.id}" end %> The Number of links is dynamic. Now if i click on link1 the div associated with it

[Rails] Help needed in Routes

2010-02-01 Thread Charanya Nagarajan
Hi All I am now using Rails 2.3.4 i would want to have a route like http://localhost:3000/mysite/questions/show.xml/question-title In Rails 2.1.2, i had used the format map.namespace :mysite do |mysite| mysite.show_question '/questions/show.:format/:title', :controller => 'mysite_questions',

[Rails] Re: Problem in Routes

2010-02-01 Thread Charanya Nagarajan
version of rails not with the newer version. Kindly help. Rails List wrote: > Charanya Nagarajan wrote: >> Hi All >> >> I had been using Rails 2.1.2 and in routes.rb i had a route defined >> like >> >> map.namespace :mysite do |mysite| >> >>

[Rails] Problem in Routes

2010-02-01 Thread Charanya Nagarajan
Hi All I had been using Rails 2.1.2 and in routes.rb i had a route defined like map.namespace :mysite do |mysite| mysite.questions '/questions.:format', :controller => 'mysite_questions', :action => 'index' end And now I have updated my rails version Now I get an error like this. Rails

[Rails] Re: Collection select options

2010-01-25 Thread Charanya Nagarajan
If you want to have a default selected value then you can use select_tag <%= select_tag :brand, options_for_select(['Brand 1', 'Brand 2', 'Brand 3', 'Brand 4'], "Brand 2") %> You had used this <%= f.collection_select :brand, ['Brand 1', 'Brand 2', 'Brand 3', 'Brand 4'], :to_s, :to_s %> in cas

[Rails] Re: Collection select options

2010-01-25 Thread Charanya Nagarajan
Pale Horse wrote: > I want to set a default on a collection select. There must be a way to > do this, but how? > >> :default => "kdjng" (?) <%= collection_select(:category, :id, @categories, :id, :name, {},{:size=>10}) %> will have the value of @category selected so you can set the default val

[Rails] Inline attachment

2010-01-25 Thread Charanya Nagarajan
Hi All I followed this link http://blog.thoughtobject.com/2007/05/26/5/ and installed inline-attachment for attaching image files in my mails. But when i add this @cid = Time.now.to_f.to_s + "lightbulb@domain.com" inline_attachment :content_type => "image/png", :body => Fil

[Rails] Alert box before Redirecting

2009-08-28 Thread Charanya Nagarajan
Hi all I have a form.On filling the details and clicking submit,i would like to pop up an alert box if the form was saved successfully before redirecting to the entry's show page. Kindly Help. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You re

[Rails] Lightbox in Rails

2009-08-24 Thread Charanya Nagarajan
Hi Actually my requirement is.. I will have a form with a submit button and then within this form i will have a link_to_remote which will update a div with some options(ie.radio buttons) and on clicking on any one of the radio button,a hidden input tag value will be set according to the selecte

[Rails] Re: Attaching files through attachment_fu

2009-08-19 Thread Charanya Nagarajan
Thank You So much Peter Your Reply helped me so much. -- 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 rubyo

[Rails] Attaching files through attachment_fu

2009-08-18 Thread Charanya Nagarajan
Hi I wish to upload a file not from the view but from the controller itself. I have the file's path and mimetype and size. I would like to know How it can be done directly from the controller Thanks in Advance -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~-

[Rails] Svn Integration with Rails application

2009-08-11 Thread Charanya Nagarajan
Hi I am trying to implement a svn browser type of function in my application.I have installed the subversion bindings for Ruby and I am following http://www.oneofthewolves.com/2007/03/06/ruby-subversion-bindings-finally-some-documentation/ this site for accessing the subversion repository from my

[Rails] Re: converting created_at to the number of days ago format

2009-05-13 Thread Charanya Nagarajan
Vladimir Rybas wrote: > Sorry, that should be > (Time.now.to_i - Time.at(@model.created_at.to_i).to_i) > > and there are questions about timezones and stuff. You need to watch > it carefully. Thank you Vladimir -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~

[Rails] converting created_at to the number of days ago format

2009-05-12 Thread Charanya Nagarajan
Hi I want to display the created_at field of my model in the format n days ago n hours ago Please help me in this -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Ruby on

[Rails] Accessing Svn through rails

2009-05-06 Thread Charanya Nagarajan
Hi I am trying to combine SVN with my rails application I want to get a file from the svn repository of the current version. My app will provide facility for the user to upload a diff file. And from this diff file and the file i got from the repository,I would like to build the file with modifica

[Rails] Re: Deleting records in association

2009-05-04 Thread Charanya Nagarajan
Paco Guzman wrote: > You may try: > > usertodelete = req.users.find(params[:id]) # Get the user to destroy > usertodelete.destroy > I do not want to delete the user .I want to delete the user entry in the requesttargetuser table. I Found out a way to do this req=Request.find(:last) user=User

[Rails] Deleting records in association

2009-05-03 Thread Charanya Nagarajan
hi, i have 3 models 1.request 2.user 3.requesttargetuser Requesttargetuser belongs_to :request belongs_to :user User has_many :requesttargetusers, :dependent=> :destroy has_many :requests,:through => :requesttargetusers Request has_many :requesttargetusers,:dependent=> :destroy has_many :use

[Rails] Re: Associations In rails

2009-04-23 Thread Charanya Nagarajan
Thanks Heinz for the reply I fixed the problem by using User Model: has_many :requests has_many :requesttargetusers has_many :targetrequests,:through=> :requesttargetusers,:source=>:request Request Model belongs_to :user has_many :requesttargetusers has_many :targetusers, :through=> :request

[Rails] Associations In rails

2009-04-23 Thread Charanya Nagarajan
Hi, I have these Models in my app User Request Requesttargetuser Now User has the associations has_many :requests And the Request has the association belongs_to :user ie.A user can post a request. But the request should be answered by certain users ie.I have to add certain other users to reply

[Rails] Re: how to call javascript function in text_field_tag

2009-04-17 Thread Charanya Nagarajan
function changecase() { (document.getElementById("sometext")).value=document.getElementById("sometext").value).toUpperCase(); } <%= text_field_tag(:sometext, nil, :size => 14 , :onchange => "changecase();") %> When u enter the text in the textbox and when the focus goes out of the textbo

[Rails] Facing a problem with rails version

2009-04-17 Thread Charanya Nagarajan
I hava an app completely developed in rails 2.1.3 and i have another app developed in Rails 2.3.2. Now I have to run the rails app 2.1.3 in my system which has rails 2.3.2. But i am not able to run it.it gives versioning errors.I changed in environment.rb too Then too throwing errors. Can Somebod

[Rails] Re: How to Apply patch

2009-04-06 Thread Charanya Nagarajan
Frederick Cheung wrote: > On Apr 6, 7:08�am, Charanya Nagarajan s.net> wrote: >> I would like to use the plugin In-Place-Editing in my app.But it >> requires a patch to be applied as given in >> "http://www.yjchen.url.tw/tips/in-place-editing-for-rails-20/"

[Rails] How to Apply patch

2009-04-05 Thread Charanya Nagarajan
I would like to use the plugin In-Place-Editing in my app.But it requires a patch to be applied as given in "http://www.yjchen.url.tw/tips/in-place-editing-for-rails-20/"; .I got the patch file and the plugin.I would like to know how can i apply patch??? Thanks in advance -- Posted via http://ww

[Rails] Re: Displaying HTML code in view

2009-03-29 Thread Charanya Nagarajan
Siddick Ebramsha wrote: > >> <% myfile.each do |line| %> >> <%= line %> > > Solution :- > <%=h line %> >/li> > >> <% end%> >> Thank You...It worked.. -- Posted via http://www.ruby-forum.com/. --~--~-~--~~~---~--~~ You received this message because you ar

[Rails] Displaying HTML code in view

2009-03-29 Thread Charanya Nagarajan
Hi, In my application i have the facility for the users to upload the file which has code ... And when i want to view the contents of the file uploaded in my view,in case if the uploaded file is an html file then i am not able to display the exact code...Instead the html content in that code gets

[Rails] Re: Auto Complete in Rails

2009-03-15 Thread Charanya Nagarajan
Charanya Nagarajan wrote: > Hi, > I am A newbee to rails.I want to add Auto complete facility in my > application.I have installed Autocomplete plugin.And i have added the > lines > > auto_complete_for :location,:name > in my controller > >

[Rails] Auto Complete in Rails

2009-03-15 Thread Charanya Nagarajan
Hi, I am A newbee to rails.I want to add Auto complete facility in my application.I have installed Autocomplete plugin.And i have added the lines auto_complete_for :location,:name in my controller and in my view i have added <%= text_field_with_auto_complete :location,:name %> and i have got