[Rails] how to open a pop-up page in rails 3 and load data from database
I am using ruby-on-rails + psql I have list of pages. On some page click I have to open page in pop-up. How I'll load data in that pop-up for specific page. -- 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 https://groups.google.com/groups/opt_out.
[Rails] how to change theme in rails 3.2.7
I'm using rails 3.2.7. I have few themes in my public/themes folder. For example in my theme-1 folder there is one index.html + style.css + few images (if required) At the time of registration user will select one theme. Now when the user will login that theme will display. I will use handle bar(http://handlebarsjs.com/) for data insertion. My main problem is that how I'll load the theme from public/themes folder to the user after login. My controller is below after user login class ClientUsersController ApplicationController def index end end Right now when user login he will redirect to index method and index.html.erb data display to him with application.html.erb layout. So how I will display the theme instead of application layout. -- 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 https://groups.google.com/groups/opt_out.
[Rails] Re: how to change theme in rails 3.2.7
Jordon Bedwell wrote in post #1073894: On Thursday, 30 August 2012 05:13:57 UTC-5, Ruby-Forum.com User wrote: end Right now when user login he will redirect to index method and index.html.erb data display to him with application.html.erb layout. So how I will display the theme instead of application layout. Store all the CSS files and image files in hierarchical (except for the stylesheets) order inside of the assets folders and then store their preference in the session and use `stylesheet_link_tag(session[:theme] || :default)` but you might add in an extra check to make sure the theme exists first I guess to prevent simple tampering. Thx Jordon But where should I keep my theme1/index.html file -- 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 https://groups.google.com/groups/opt_out.
[Rails] Re: how to change theme in rails 3.2.7
Jordon Bedwell wrote in post #1073902: On Thursday, 30 August 2012 05:26:14 UTC-5, Ruby-Forum.com User wrote: Thx Jordon But where should I keep my theme1/index.html file Depending on what it has in it, what I would do is turn it into a template in the folder of the controller and just add a manual render at the bottom of the controller that triggers based on the theme. So if your controller is UserController and the theme is theme1 then I would make theme1/index.html into app/views/user/theme1.erb and then do render :theme1 in the controllers action. Though at the point I don't know what you would need mustache/handlebar for unless it's entirely Ajax. Thx Jordon Now I'll put theme folder in view section app/views/themes/theme1 app/views/themes/theme1/index.html app/views/themes/theme1/style.css app/views/themes/theme1/image Is it not possible if I put all these folders in public public/themes/theme1 public/themes/theme1/index.html public/themes/theme1/style.css public/themes/theme1/image -- 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 https://groups.google.com/groups/opt_out.
[Rails] how to do render partial on jquery ajax success method with rails 3
I'm using rails 3.2.1 with jquery for an ajax call. My juqery code is : jQuery.ajax({ url: /org_pages, data: 'org_id='+ org_id, type: POST, success: function(result){ jQuery(#image_center).html(%= escape_javascript(render(:partial = 'pages/top_link')) %); }, error: function(){ alert('Error occured'); } }); My problem is on the web page the output is showing this : %= render :partial = 'pages/top_link', :collection=@pages % How it should display my render partial page. :( -- 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 https://groups.google.com/groups/opt_out.
[Rails] Re: how to do render partial on jquery ajax success method with rails 3
That is a .js file. -- 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 https://groups.google.com/groups/opt_out.
[Rails] how to load graph after loading other data
I'm using rails 3.2.1 My page is divided into 5 parts part-1 header part-2 div area part-3 graph part part-4 data in tabular format part-5 footer Now my problem is that graph take too much time to upload. Due to which this page take too much time to load. Please tell me any method so that my graph load in the last but other data will display. -- 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] How to get password from database using devise
Hi all I'm using rails 3.2.1 + devise 2.0.4 My problem is that in my website only : Admin will create new users no direct registration for users. Now when Admin create new_user confirmation mail will be send to the user email id. The content of the mail is user_name user_password But the password come in encrypted format. How I'll get password in readable form. -- 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: Re: How to get password from database using devise
Tyler wrote in post #1065431: On Wednesday, June 20, 2012 8:20:13 AM UTC-7, ixti wrote: I understand the use case, but still doesn't make sense to store the password in plain text in the database. It's actually even more pointless if all the users are admins... then they call all just see each others' passwords. And it gives the illusion of security, when in actuality it's one params vulnerability away from giving all-encompassing access to any hacker that wants it Dear Tyler I don't want to store password in plain text in database. I just want to send an email to user that your login password is this. Devise will store password in encrypt form in database. -- 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] how to use oncomplete in Rails-3.2.1 Ajax
I'm using Rails-3.2.1 and working on ajax. Below is my code and I want to add woking in progress msg while my function is in progress. == example.html.erb file div id=showmsg Once you approve it will publish. nbsp; span id=status_section [nbsp; %= link_to Approve, {:action=approve_status, :id=params[:id], :stat=approved}, :remote=true % nbsp; | nbsp; %= link_to Reject, {:action=approve_status, :id=params[:id], :stat=rejected}, :remote=true % nbsp;] /span /div == controller method def approve_status @camp_id = params[:id] @camp_stat = params[:stat] @campaign = Campaign.find_by_id(@camp_id) @campaign.approved_status = @camp_stat end == example.js.erb file jQuery.noConflict(); jQuery(#showmsg).hide(); jQuery(#app_stat).html(%= @camp_stat %); == How to use ajax complete or success in this? -- 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] whenever cron is not working with rails-3
I'm using Whenever for the first time. My cron is not working on the production server. I m using rails-3.1.2 In my schedule.rb file every :hour do # Many shortcuts available: :hour, :day, :month, :year, :reboot runner Report.create_report, :environment=development end every 2.minutes do runner Report.create_report2 , :environment=development end In my Report model file def self.create_report r = Report.new r.ad_network_campaign_id =1 r.ad_network_campaign_name=2 r.save end def self.create_report2 r = Report.new r.ad_network_campaign_id =5 r.ad_network_campaign_name=5 r.save end After this I run the command whenever --update-crontab project_name In my crontab crontab -l # Begin Whenever generated tasks for: jigserv 0 * * * * /bin/bash -l -c 'cd /var/www/jigserv script/rails runner -e production '\''Report.create_report'\''' 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58 * * * * /bin/bash -l -c 'cd /var/www/jigserv script/rails runner -e production '\''Report.create_report2'\''' # End Whenever generated tasks for: jigserv In the last my data is not inserted in the Report table as I 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] jquery validation function not working properly with rails 3.2.1
I'm using Rails -3.2.1. In one of my form I'm using jquery validation. My form is below -- new_account.html.erb %= form_for(@account, :url ={:action= create_account}) do |f| % table width=80% border=1 align=center cellpadding=5 cellspacing=5 tr td width=30% %= f.label :Account_Name, :class = :style1_bold % /td td %= f.text_field :account_name, :class =input_border required ONLY_ALPHABET % /td /tr tr td nbsp; /td td %=f.submit Add Account % %= link_to Cancel, home_path, :class=style2_link % /td /tr /table % end % -- In application.js //= require jquery //= require jquery_ujs // require_tree . //= require_directory . jQuery.noConflict(); jQuery(document).ready(function(){ / Validatior for only alphabet / jQuery.validator.addMethod(ONLY_ALPHABET,function(value,element){ return this.optional(element) || /^[a-zA-Z ]+$/.test(value); },Only Alphabet is allowed); / Validation for Create Account / jQuery(#new_account).validate( { rules: { account_account_name: { required: true, ONLY_ALPHABET: true, maxlength: 30 } }, messages: { account_account_name: { required: Please fill category, ONLY_ALPHABET: Only Alphabet is allowed, maxlength: Not more than 30 characters } } }); }); -- On Form submit. It doesn't show my message instead it show jquery default messages. I include this file jquery.validate.min.js -- 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] Google calendar is not working properly with gcal4ruby (0.2.6)
I'm using Rails - 2.2.2 gcal4ruby (0.2.6) I'm using google calendar to display events for users in my website. Till 18-march-2012 everything was working fine. But now whenever user add events to the calendar it show only busy in the calendar. My code is def add_event user_id = current_user.id service = GCal4Ruby::Service.new service.authenticate(usern...@gmail.com, password) calendar = GCal4Ruby::Calendar.find(service, 'Events' , {:scope = :first}) title = params[:events][:location].upcase+' - '+params[:events][:traveller].upcase+' - '+params[:events][:title] event = GCal4Ruby::Event.new(calendar) event.title = title event.content = params[:events][:content] event.where = params[:events][:location] event.start = Time.parse(#{sdate} at #{kstime} ) event.end = Time.parse(#{edate} at #{ketime}) if !event.save return false else event_id = event.id Event.add_event(event_id,params[:events][:traveller],params[:events][:title], params[:events][:content], params[:events][:location], sdate, stime, edate, etime, user_id) end redirect_to :action=index end Attachments: http://www.ruby-forum.com/attachment/7167/37.jpg -- 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] CSV problem with migration but working fine in controller
I'm getting problem with csv. When I use below code in my Controller method then it works but when I put this in my migration then this don't work. Why so In My Controller's index method. It works. require 'csv' CSV.foreach(#{Rails.root}/db/adwords_location_data/languages.csv) do |row| obj_language = Language.new obj_language.name = row[1] obj_language.adwords_id = row[0] obj_language.save end === But When I write this in my migration this doesn't work. No error come but data didn't inserted in the tables. Below is the migration code. require csv class LoadLanguageData ActiveRecord::Migration def self.up CSV.foreach(#{Rails.root}/db/adwords_location_data/languages.csv) do |row| obj_language = Language.new obj_language.name = row[1] obj_language.adwords_id = row[0] obj_language.save end end def self.down Language.destroy_all end end -- 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] how to use link_to with :remote=true in rails 3.2.1
I m using Rails 3.2.1. how to use link_to with remote=true My Method in Controller def clickme @clk = you click me respond_to do |format| format.js { render :layout=false } end end My View In my new.html.erb file %= link_to click here, {:action=clickme}, {:remote = true, :id=clk} % div id=allclick %= render :partial = 'goclick' % /div _goclick.html.erb %= @clk % clickme.js.erb $(allclick).update(%= escape_javascript(render(:partial = goclick)) %); On my web-page everything is fine when I click on click here link nothing change. But when I check Firebug console it shows me: $(allclick).update(you click me); Help 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-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: how to use link_to with :remote=true in rails 3.2.1
Tim Shaffer wrote in post #1049440: You probably want to use $(#allclick).update instead of $(allclick).update Note the # that indicates you are selecting an element by the ID. I'm using $(#allclick).update -- 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: how to use link_to with :remote=true in rails 3.2.1
after doing some googling I got the answer wrong way : $(#allclick).update(%= escape_javascript(render(:partial = goclick)) %); correct way : $(#allclick).html(%= escape_javascript(render(:partial = goclick)) %); Instead of update now I'm using html -- 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: Object doesn't support #inspect in rails 3.2.1
Valery Kvon wrote in post #1048646: I got the output but when I do c.campaign_reports I got (Object doesn't support #inspect) = Update ruby to 1.9.3 (much more stable). Be sure you've updated Rails correctly (Gemset file and all configs). Update all gems you have and bundle it again. If nothing happens, revise all third-party libs and plugins for incompatibilities. Hi I just create one new project and everything work fine there. But in my migrate project console is not working properly. Following process I follow - 1) Create new rails application 2) shifting old code to new rails 3) all gems in Gemfile is updated 4) Using Restful authentication plugin for rails 3.2.1 -- 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: Re: Object doesn't support #inspect in rails 3.2.1
Colin Law wrote in post #1048648: On 24 February 2012 13:43, Manish N. li...@ruby-forum.com wrote: I got error NoMethodError: undefined method `zero?' for :+:Symbol What do you see when you do c=Campaign.first in the console, and what if you do cr=campaign_reports.first I have to agree with Manish, it sounds like an gem not updated to correct version. Colin How can I find which gem is not updated to correct version? -- 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: Object doesn't support #inspect in rails 3.2.1
what I found is this /home/manish/.rvm/gems/ruby-1.9.2-p290/gems/soap4r-1.5.8/lib/soap/property.rb:68: warning: encoding option is ignored - u /home/manish/.rvm/gems/ruby-1.9.2-p290/gems/soap4r-1.5.8/lib/soap/property.rb:69: warning: encoding option is ignored - u /home/manish/.rvm/gems/ruby-1.9.2-p290/gems/soap4r-1.5.8/lib/soap/property.rb:70: warning: encoding option is ignored - u -- 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: Net::SMTPAuthenticationError
config.action_mailer.smtp_settings = { :address = 'smtp.gmail.com', :port = 587, :domain = 'gmail.com', :user_name= 'my_n...@gmail.com', :password = 'secret_password', :authentication = 'login', :enable_starttls_auto = true } -- 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: How to set up a has_many :through association with Ultrasphinx
Thanx for your information. Wasting half a day I found your post and this help me so much. Thanx a lot :) -- 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: Run Rake from Controller/View?!
Dear Ingmar Hamer Thank you for your support to run rake task with system('rake ultrasphinx:index:delta') I have to run rake ultrasphinx:index:delta after every entry in database so I use this command It help me so thx 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-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] Ultrasphinx help
I switch from ferret to ultrasphinx. In my table user I have following fields id, firstname, lastname, login, password, created_at, updated_at is_indexed :fields = [{:field = :login},{:field = :firstname},{:field = :lastname}] Now what I want is to search with a character like if you write 'm' then search m in login field where ever it find 'm'. In ferret it works. -- 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 2.3.x documentation archive?
Tom wrote: Hi, I'm a developer on several projects using rails 2.3.4 and since the release of 3.0, I haven't been able to find any documentation for 2.3.4 online. I have the rdocs from the gem install, but haven't been able to find anything else. Is this stuff archived somewhere? Thanks! -Tom I agree with Tom -- 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: How to create XML
radhames brito wrote: http://api.rubyonrails.org/classes/ActionView/Base.html thank u radhames brito. If I get any problem in this. I'll again disturb u. -- 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: how to call rails method from javascript method.
radhames brito wrote: call the action like /controller_name/action_name.js this from the javascript file, if the call is ajax make your controller respond to js then the file action_name.js is really named action_name.js.rb file there do %=render :text = user.id% this is what should happen, you call from the javascript /controller_name/action_name.js, this goes to the route and matches map.connect /:controller/:action.:format you see the format at the end ? rails will return the action_name.js.rb ignoring the rb part as it does with index.html.rb that file will render the text with the user id, another option is returning a json object, read a bit about it because i think json is the way to go. Hi radhames brito again diturbing you. Please give me the link for this also. -- 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: mysql2
radhames brito wrote: at least its solved right? you are talking about window or linux ? -- 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: Rails 3 not working with windows 7
radhames brito wrote: You have a other rails 3 apps that are running with mysql2 on windows 7 and this one doesnt work or you are not able to find th gem for windows 7? Hi radhames brito This is my first application with rails 3 other application are with rails 2.3.8 the same problem occurs with 3.0.0.rp this version also. -- 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] How to create XML
hi I wanna crate XML file in this format. rsp status_code=0 status_message=Success daily_counts count date=20100415T00:00:00214/count count date=20100409T00:00:00205/count count date=20100410T00:00:0014/count count date=20100411T00:00:0044/count count date=20100402T00:00:0021/count count date=20100422T00:00:00241/count count date=2010041T00:00:0014/count /daily_counts /rsp when I user render :xml = @service then it pick all the data from the table and show. But the format is not what I want. my table name is service-enquiries. service-enquiries type=array service-enquiry user_id type=NilClass6/user_id date type=NilClass2009-06-22/date /service-enquiry /service-enquiries How I change the format? -- 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: XML builder
bensomers wrote: Try using send to send the element name. So element_name = :tag xml.send(element_name) Brandon thanx for your help. It was really helpful how can I add attribute. I want in this format count date=20050412T00:00:00214/count how can I add attribute date. -- 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: Rails 3 not working with windows 7
radhames brito wrote: Then it could be that mysql2 is not supported Then wht the solution? -- 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: Rails 3 not working with windows 7
Manish Nautiyal wrote: radhames brito wrote: Then it could be that mysql2 is not supported Then wht the solution? From surfing net for so long what I got is this. The mysql2 gem does not currently support Windows (although I hear they are working on it). Just use the old mysql gem for now. To be specific: 1. Put this line in your Gemfile: gem 'mysql', '2.8.1' 2. Run bundle install 3. Make sure you use adapter: mysql and not adapter: mysql2 in your database.yml. This is how my system is currently set up, and it works fine with Rails 3.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] Re: How to create XML
radhames brito wrote: user builder to build your xml template and render the template create a file service.xml.builder in the view directory for that controller then xml.rsp(:status_code = 0, :status_message= Success) xml.daily_counts @services.each do |service| xml.count(service.code,:date= service.date) end end then render = services there you have it rsp status_code=0 status_message=Success daily_counts count date=20100415T00:00:00214/ count count date=20100409T00:00:00205/count count date=20100410T00:00:0014/count count date=20100411T00:00:0044/count count date=20100402T00:00:0021/count count date=20100422T00:00:00241/count count date=2010041T00:00:0014/count /daily_counts /rsp Hi radhames brito thanx for your support. Can you give the link from where I learn more. How to create XML. what you tell me above is very nice. But I wanna know how it is working. so pls if possible give me the link. -- 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 3 not working with windows 7
radhames brito wrote: Errr, this does not seem to be related to rails 3 it seems like you dont have mysql.gem installed , try gem install mysql Hi Thx for your quick help. But the problem is that I have rails version[3.0.0, 3.0.0.rp, 2.3.8] And my two version is working gud with mysql. Only in new version 3.0.0 it show error message. I installed mysql gem . But the problem still exists. -- 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 call rails method from javascript method.
radhames brito wrote: read on link_to_remote and please be more specific I am more specific now. There is one swf file. When I click on that swf file it will return user_id. And below that swf file I have to show detail of the specific users. The detail will come from database. Now the problem is that there is small javascript function which will give me the user id. So from that javascript function I wanna call rails method which will fetch data from database and show it where I 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-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 3 not working with windows 7
ruby 1.8.7 gem 1.3.7 rails 3.0.0, 3.0.0.rc when i write rails -v error message come Could not find gem 'mysql2 =0, runtime' in any of the gem sources. Try running 'bundle install'. when I run bundle install then also it cann't install mysql2 please help 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...@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] how to call rails method from javascript method.
hi I wanna call rails method from the javascript method. It should be ajax call for rails method. please help 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...@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: rake db:create = LIBMYSQL.DLL not found. how to solve??
Rails Terrorist wrote: [1] gem install mysql [2] you will see like error syntac but dont pay attention to it [3] find LIBMYSQL.DLL from your mysql/bin folder in your mysql folder not ruby folder. [4] copy paste that file to ruby/bin [5] restart your server or console, if you are already run it. Then Cheer, Reinhart http://teapoci.blogspot.com Thanx Reinhart this helps me to run rails on windows. -- 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: NameError in CompetitorsController#index
Frederick Cheung wrote: On May 15, 9:28�am, Manish Nautiyal li...@ruby-forum.com wrote: class Competitor ActiveRecord::Base Is this in app/models/competitor.rb (case is probably important) ? Fred Yes it in the app/models/competitor.rb -- 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: NameError in CompetitorsController#index
Hassan Schroeder wrote: On Sat, May 15, 2010 at 12:28 AM, Manish Nautiyal li...@ruby-forum.com wrote: I am getting this problem when I run this code in server. In my localhost everything is running fine. But when I deploy my code in the server it shows me the error. �def index � �...@compet = Competitor.find(:all) � ### GETTING ERROR IN THIS LINE Are you sure all your migrations have run successfully on the server? What happens if you open a console and try `Competitor.find(:all)` ? -- Hassan Schroeder hassan.schroe...@gmail.com twitter: @hassan Yes Hassan all my migrations have run successfully on the server. On the server there is no console facility. -- 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] NameError in CompetitorsController#index
Hi all I am getting this problem when I run this code in server. In my localhost everything is running fine. But when I deploy my code in the server it shows me the error. I am using FERRET SERARCH IN MODEL. NameError in CompetitorsController#index uninitialized constant CompetitorsController::Competitor RAILS_ROOT: /home/troche/mrecip_tool/releases/20091219131859 Application Trace | Framework Trace | Full Trace /opt/ruby_enterprise/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:102:in `const_missing' /home/troche/mrecip_tool/releases/20091219131859/app/controllers/competitors_controller.rb:19:in `index' My controller is class CompetitorsController ApplicationController include AuthenticatedSystem layout 'application' auto_complete_for :proscribed, :competitor auto_complete_for :fee_earner, :fee_earner protect_from_forgery :only = [:tag] before_filter :login_required, :only = [:index, :show, :new, :edit] @@total_company = 70 # GET /competitors # GET /competitors.xml def index @compet = Competitor.find(:all) ### GETTING ERROR IN THIS LINE respond_to do |format| format.html # index.html.erb format.xml { render :xml = @compet } end end # GET /competitors/1 # GET /competitors/1.xml def show @competitor = Competitor.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml = @competitor } end end # GET /competitors/new # GET /competitors/new.xml end My Model is class Competitor ActiveRecord::Base validates_presence_of :fee_earner_id, :notes belongs_to :fee_earner belongs_to :country belongs_to :state belongs_to :user acts_as_ferret :fields =[:competitor, :client, :subject_matter],:remote = true end -- 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] NameError when using acts_as_ferret
Hi all I am getting this error when I am using acts_as_ferret :fields =[:competitor], :remote = true NameError in PartController#index uninitialized constant PartController::Competitor My Model class Competitor ActiveRecord::Base validates_presence_of :fee_earner_id, :notes belongs_to :fee_earner belongs_to :country belongs_to :state belongs_to :user acts_as_ferret :fields =[:competitor], :remote = true end * My controller class PartController ApplicationController @@total_company = 70 def index @proscribeds = Competitor.paginate(:all, :order = sort , :page = params[:page], :per_page = @@total_company ) end end -- 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 run a cron file
Jeffrey L. Taylor wrote: Quoting Manish Nautiyal li...@ruby-forum.com: /mnt/apps/NearbyAd/current/lib/camp.rb Try * * * * * cd /mnt/apps/NearbyAd/current; ./script/runner -e production lib/camp.rb HTH, Jeffrey Thx Jeffrey Its work. many many thanks -- 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: Ruby on Rails Associations - Practical Applications
Cam wrote: Hey All, Forgive me for posting a question that may be very elementary. I'm building an application and am a bit stuck on how to work out the associations. It goes like this: User :has_many vehicles User :has_many logs Vehicle :has_many logs User - Vehicles - Logs The Vehicles have a user_id attribute. The Logs have user_id and vehicle_id attributes. I am using restful authentication and am able to associate the vehicles with the users al a - def create @vehicle = current_user.vehicle.build (params[:vehicle]) .. -- I can't figure out how I should do it for the log. Thanks again, and sorry for my lack of understanding of how rails works. Cheers, Cam Peterson In User model write has_many :logs has_many :vehicles In Vehicle model write has_many :logs In your logs model write belongs_to :user belongs_to :vehicle In your vehicle model write belongs_to :user def create @vehicle = current_user.vehicle.create (params[:vehicle]) -- 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] how to run a cron file
Hi all I want to run this in production mode. RAILS_ENV=production ruby script/runner lib/camp.rb in cron file. what i have done in cron file is below * * * * * RAILS_ENV=production /usr/bin/ruby /mnt/apps/NearbyAd/current/script/runner /mnt/apps/NearbyAd/current/lib/camp.rb but i didn't get any success. /usr/bin/ruby i got from which ruby please help 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...@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: script/runner and cron, funny behavior
Ryan Mohr wrote: I couldn't figure out why my cronjobs weren't executing correctly. They would run, but the code would not be executed. Here's what the problem was: This was the cronjob that was not working correctly: * * * * * /path/to/app/script/runner -e production Code.to_execute And this is what I had to do to get it to work: * * * * * cd /path/to/app/; ./script/runner -e production Code.to_execute Why does changing into the app's directory before executing runner make a difference? Anyone else run into this before? Hi Ryan Mohr Thx very much for your answer. I am also facing the same situation before reading your post. Now me 2 execute my cron file successfully. Thank 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-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] ar_sendmail is sending mail twice
Hi all I am using ar_sendmail for sending mail. Its working fine but sometimes it sends a mail twice to a single user. Why this happens ? Plz help 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-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: NoMethodError in Stories#show
Hey paul can u paste your show url. bcoz in your show method you have write def show @story = Story.find(params[:id]) end your url must be.. http//localhost:3000/stories/show/id so please paste your show url where you get error. Colin Law wrote: 2009/9/30 paul.denlin...@gmail.com paul.denlin...@gmail.com: -- Showing app/views/stories/show.html.rb where line #1 raised: You have a nil object when you didn't expect it! The error occurred while evaluating nil.name Extracted source (around line #1): 1: h2%= @story.name %/h2 The error means that when it tries to display @story.name then @story is nil. This likely means that the find used to setup @story in your controller did not find a record. I suggest having a look at the rails guide on Testing Rails Apps at http://guides.rubyonrails.org/ This may help you to work out what is wrong. In addition the Getting Started guide and ActiveRecord Associations are compulsory reading. Colin -- 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: HELP FOR SEPARATING TIME
Hi Newb newb use @date.strftime(%B %d, %Y) to display only date no time. and in table insert September 30, 2009 03:08 PM Newb Newb wrote: Brijesh Shah wrote: just remove :time option from the syntax.. thanks for the reply... actually i need time and date aswell . but i want to split the date and time .. how can i do it September 30, 2009 03:08 PM -- 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: Is it possible to deploy a rails app, or is that something that cannot be done yet?
Leonardo Mateo wrote: On Wed, Sep 30, 2009 at 12:54 AM, DM davemak...@gmail.com wrote: Is it possible to deploy a rails app, or is that something that cannot be done yet? Something like what? Have you tried? -- Leonardo Mateo. There's no place like ~ Please explain more clearly. -- 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: Ruby on Rails drop down help
For Static %= select_tag recipro, options_for_select([ Received, Sent, Go], Received) % --- For Dynamic %= select(fir, country, @top.collect {|p|[p.id, p.countryname]},{:include_blank = 'Select Country'}) % -- 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: validation problem
Wap Addon wrote: Matt Jones wrote: Don't think like this - as other posters have pointed out, you're going to have to do server-side validation anyways. Worrying about the execution time of something this small is exceptionally premature optimization. In your example, the JS validation may work, but you're still going to have to validate server-side, as some users may have JS turned off. --Matt Jones On Aug 22, 5:43�am, Wap Addon rails-mailing-l...@andreas-s.net ok dear that's true Use Live Validation. %= f.submit 'Create', :onClick = 'new_animal()' % function new_animal(){ alert('animal'); if(document.getElementById('animal_name').value==) { alert(Enter name...); document.getElementById('animal_name').focus(); return false; } if(document.getElementById('animal_desc').value==) { alert(Enter animal description ...); document.getElementById('animal_desc').focus(); return false; } return true; } hope it will run... -- 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 validation
Wap Addon wrote: hello guys i am using model validation with ajax i have new.html.erb it is call through link__to_remote() then press create if any validate require page will redirect to it actual controller for ex. admins/new something like this i want display validation message on same page in this command url can not change in all page url remain same, if any one having idea about it please share with me. Can you show me your code. method in controller + html view all code. -- 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 -~--~~~~--~~--~--~---