[Rails] New Rails CMS and rapid web development tool
After more than three years of development I am excited to announce DRG CMS to the world. DRG CMS is alternative way of programming application in Ruby on Rails. Instead of creating controllers and views for each collection (table) model, DRG CMS introduces single (cmsedit) controller which uses DRG Forms to control CRUD database operations. DRG CMS uses Mongo DB, leading NO-SQL document database, as database back-end with a help of mongoid gem. Mongoid's flexible document model defines all document fields, indexes, dependencies, validations in single model file with no Rails migrations required. DRG CMS can coexist with other frameworks which use Mongo DB as database back-end. Use your favorite framework for presenting data on web and use DRG CMS with its easy to create DRG Forms as data entry back-end. DRG CMS can coexist with other databases and Rails controllers. I can highly recommend using DRG CMS in heterogeneous database Intranet projects. I am currently actively developing in-house application which uses MongoDB as primary database and connects frequently to Oracle and MS-SQL databases. Main DRG CMS features: - Uses MongoDB with Mongoid ODM as database back-end - Multiple sites on single Rails instance. All sites can share design, data, users ... - Every site may have its own Rails layout (own javascript and css files) or share layout with other sites - Every site may have its own main data pages collection or can share pages content with other sites - Single (cmsedit) Rails controller, controlled by DRG Forms - DRG Form entry fields can be extended by adding classes to DrgcmsFormFields module - Form generator - Optimistic locking - Journal with option to undo single field anywhere back in time - Two level role based access system. First level defines users with rights to view or modify page data (have CMS menu enabled). Second level defines granular access for every collection - i18n internationalization support with Slovenian translation included - Integrates CK Editor as HTML editor with drg_default_html_editor gem - Integrates elFinder file manager with drag&drop support and role based access to file system Visit project homepage http://www.drgcms.org, go to demo page and walk build in CMS. If you are interested, visit project source code on Github repository https://github.com/drgcms. You are welcome to contribute to the project. You may also follow this instructions http://www.drgcms.org/books/chapter/drgcms-documentation/0103-create-web-site-in-15-minutes link and try to make web site in 15 minutes. By Damjan Rems, http://www.drgcms.org -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a09f8ad4-acb8-40f7-a57a-0053a2f59a5b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[Rails] New open source CMS combining Rails and MongoDB
After more than three years of development I am excited to announce DRG CMS. DRG CMS is alternative way of programming application for Ruby on Rails. Instead of creating controllers and views for each collection (table) model, DRG CMS introduces single (cmsedit) controller which uses DRG Forms to control CRUD database operations. DRG CMS uses Mongo DB, leading NO-SQL document database, as database back-end with a help of mongoid gem. Mongoid's flexible document model defines all document fields, indexes, dependencies, validations in single model file with no Rails migrations required. DRG CMS can coexist with other frameworks which use Mongo DB as database back-end. Use your favorite framework for presenting data on web and use DRG CMS with its easy to create DRG Forms as data entry back-end. DRG CMS can coexist with other databases and Rails controllers. I can highly recommend using DRG CMS in heterogeneous database Intranet projects. I am currently actively developing in-house application which uses MongoDB as primary database and connects frequently to Oracle and MS-SQL databases. Main DRG CMS features: - Uses MongoDB with Mongoid ODM as database back-end - Multiple sites on single Rails instance. All sites can share design, data, users ... - Every site may have its own Rails layout (own javascript and css files) or share layout with other sites - Every site may have its own main data pages collection or can share pages content with other sites - Single (cmsedit) Rails controller, controlled by DRG Forms - DRG Form entry fields can be extended by adding classes to DrgcmsFormFields module - Form generator - Optimistic locking - Journal with option to undo single field anywhere back in time - Two level role based access system. First level defines users with rights to view or modify page data (have CMS menu enabled). Second level defines granular access for every collection. - Integrates CK Editor as HTML editor with drg_default_html_editor gem - Integrates elFinder file manager with drag&drop support and role based access to file system If you are interested, visit project home page at http://www.drgcms.org, visit this http://www.drgcms.org/books/chapter/drgcms-documentation/0103-create-web-site-in-15-minutes link and create DRG CMS web site in 15 minutes. Project source code is hosted https://github.com/drgcms Github repository. You are welcome to contribute to the project. -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/09fcd82810e7e10047f2bf7257fb0b37%40ruby-forum.com. For more options, visit https://groups.google.com/d/optout.
[Rails] Re: Strange mailer behaviour in Rails 4.2
Colin Law wrote in post #1168195: > On 17 February 2015 at 09:56, Damjan Rems wrote: >> The code inside test method doesn't get executed at all. >> >> class MailSender < ActionMailer::Base >> default :from => 'no.reply@some.where' >> >> def test() > > Should that not be > def self.test() > if you want to call it using > MailSender.test() > > Colin No. It is called from controller. by TheR -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a9ea5a9e631c777352d6883559b15833%40ruby-forum.com. For more options, visit https://groups.google.com/d/optout.
[Rails] Strange mailer behaviour in Rails 4.2
The code inside test method doesn't get executed at all. class MailSender < ActionMailer::Base default :from => 'no.reply@some.where' def test() should_die_here mail( :to => 't...@to.com', :subject => 'Test', :text => 'Text').deliver end end ## In controller: MailSender.test() # nothing happen MailSender.test1() # throws error, method test1 not found. First call should die in should_die_here line, but nothing happens. Funny thing is if I try to call nonexisted method I get error, that method does not exist. When I reverted to rails 4.1.19 everything works as expected. Thanks for your advice TheR -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/cba0e7699a949aa76a01b3f98f49f477%40ruby-forum.com. For more options, visit https://groups.google.com/d/optout.
[Rails] Anybody knows what happend to planetrubyonrails.com
Is there any other good rails related articles hub on the net? by TheR -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4df3a15893145ff765ff75ed26259846%40ruby-forum.com. For more options, visit https://groups.google.com/d/optout.
[Rails] Re: How to configure default options of "ckeditor_rails" gem
My solution is specific to CMS I am building. My biggest cracker at the moment is documentation ;-) It took me about two days to crack toolbar. Although everything is in ck documentation http://docs.ckeditor.com it is very muddy ;-( Put this somewhere into ck_config.js CKEDITOR.editorConfig = function( config ) { config.toolbar_basic = [ [ 'Save', '-', 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ], [ 'Bold', 'Italic', 'Underline', '-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'] ]; //You may reconfigure toolbar for all sessions config.toolbar = config.toolbar_basic; }; Or comment out last line and put into ckeditor object initializer for specific session: CKEDITOR.replace( 'record_body',{height: 500, customConfig: '/ck/ck_config.js', contentsCss: '/ck/ck_css.css', toolbar: 'basic'} ) by TheR -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2fe1089484dc1074f528094837857cd7%40ruby-forum.com. For more options, visit https://groups.google.com/d/optout.
[Rails] Re: How to configure default options of "ckeditor_rails" gem
New to Rails and you started probably with the hardest cracker by my opinion ;-) CK loads setting dynamical when it is loaded into browser. Which can not be done right with assets pipeline. If you read documentation on github you will see this: -- Customize ckeditor In order to configure the ckeditor default options, create files: app/assets/javascripts/ckeditor/config.js app/assets/javascripts/ckeditor/contents.css -- It should probably work. I don't use this gem. I kinda made CK work by myself and I put config files directly to public folder (I can have multiple configs for multiple sites). Location of configuration files can be set in javascript when object is initialized. by TheR -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d8619aa42f7669162421235679b002f7%40ruby-forum.com. For more options, visit https://groups.google.com/d/optout.
[Rails] Re: How to include a vendor multi-module JS library in Rails?
You probably have same problem that I was writing in this post. https://www.ruby-forum.com/topic/5503104 Javascript library is trying to load modules in runtime. Your chance is to place javascript files directly to the place (url) where they are required. Look at the url in error and put javascript files there. by TheR -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a3aae2446203c2413406c6c504355e29%40ruby-forum.com. For more options, visit https://groups.google.com/d/optout.
[Rails] Copying javascript files to destination assets directory (almost) without assets pipeline
In my project I am using ckeditor as default HTML editor. One of the strongest feature of ckeditor is that all its components are loaded from server when started and can thus be easily extended. Which is also a nightmare for rails developers because this problem cannot be solved by assets pipeline especially if used as gem. In ckeditor gem, which can be found on github https://github.com/galetahub/ckeditor the problem was solved by adding every single required file to app.config.assets.precompile which made (in my case) assets compilation go from 1 minute to >5 minutes. What is not acceptable. Not until recently I found out assets:precompile rake task (why is this so poor mentioned in documentation). Which can be added to every gem and it is executed once when rake assets:precompile is invoked. So here is my solution now: (file lib/tasks/copy_assets.rb) require 'fileutils' desc "Copy all ckeditor files from gem's javascript folder to public/assets/folder" task "assets:precompile" do p 'Copying ckeditor directory to public/assets folder *' input_dir = File.realpath( File.dirname( __FILE__ ) + '/../../app/assets/javascripts/ckeditor') output_dir = Rails.root.join('public/assets') cp_r(input_dir, output_dir, verbose: true) end It works perfectly for me. Is there any problem to be expected except the usual ones with browser caching? by TheR -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/6208cde91e536159598f4f279b8017d9%40ruby-forum.com. For more options, visit https://groups.google.com/d/optout.
[Rails] Calling link_to from rake task
I have a rake task, which informs users about all kind of statuses in the application by e-mail. It would be nice if I could create active links together with statuses. But have noticed that link_to helper is not available for rake or ActionMailer. Is there an easy way to include link_to helper in rake or example below is the only sane way of doing it :-( body << 'http://my.site.com/link";>Link' by TheR -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9f43fef5b39474f43ef3929d56a827b4%40ruby-forum.com. For more options, visit https://groups.google.com/d/optout.
[Rails] Re: How to put everything from directory into assets as subdirectory
It is not that I don't use assets pipeline. I do. And I like it. I just would like to know if there is any mechanizm inside Rails, that would automaticaly copy whole content from one directory to ../public/assets directory. Or must I do it by hand. by TheR -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8ed796950a56509f41672f62c0512581%40ruby-forum.com. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] How to put everything from directory into assets as subdirectory
By everything I mean everything. Untouched by assets pipeline. External javascript libraries, like CK Editor for example, dynamicly load javascript and css in runtime, depending on settings. So compiling them with assets pipeline into one file makes no sense, even worse it doesn't work at all. Is there a mechanizm in rails to copy all files from ex. ../gems/../lib/assets/ck_editor to ../assets/ck_editor directory. It is hard to automate copying since it is a moving target, due to gems versions, so it has to be done by hand. Funny thing is that everything works in development, but of course not in production, since assets pipeline has no mechanizm to move whole directory into assets directory. Or have I missed something obvious? by TheR -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/aaf04f195dededf06e5db4e5a76f2cf8%40ruby-forum.com. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] Is it possible to run some script before controller is hit
This has everything to do with new European cookie law ;-( Is it possible to start some script (on every call), before rails application is hit. Script would check for the presence of a cookie and if it is there just pass control forward. If not it would popup window about legal stuff and redirect to original address. I am using Rails 3.2 with Passenger and Nginx. by TheR -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c1ed15ee2a9b31fbce714556275f17e9%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] Re: where exactly are gems?
.bundle I usualy change it to vendor: bundle install --path vendor by TheR -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] Question about ActiveSupport::Concern and mongoid model definition
I am using mongoid and MongoDB and have come lately to a very tough problem and I need an advice. I am working on a CMS and one of the ideas was that CMS would provide some basic models definitions and end user would, if needed, extend basic class with its own extension and save them to different collection (table). class DcPage include Mongoid::Document field a belongs_to b validates a end class MyPage < DcPage field c validates c end Up until last version of mongoid this worked (with little hack) and data would be saved to my_pages collection. Because of some problem, they no longer support this behaviour and data always gets saved to dc_pages collection. When explaining my problem, they suggested that I use ActiveSupport::Concern and provided me with an example. Which works perfectly OK if extended class is defined in same source file. Which btw. never happens in praxis. module CommonBehaviour extend ActiveSupport::Concern included do field :subject, type: String, default: '' # ... end end class DcPage include Mongoid::Document include CommonBehaviour end class MyPage include Mongoid::Document include CommonBehaviour end So far I have found out that it works if I require basic source file in my second file. Which looks like this: require '/some/path/to/my/gem/app/models/dc_page.rb You can see my pain. Basic source file would of course be backed into gem and therefor becomes a moving target. Please help me with better solution. by TheR -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] How todiffer if params are set through form or through url
Is there a way to differ if params are set through form submit: <%= form_tag action: 'login', method: :put do %> <%= text_field('record','username') %> <%= password_field('record','password') %> <%= submit_tag %> or through url http://some.site/login?record[username]=user&record[password]=pwd In both cases they appear in controller as params[:record][:user] and params[:record][:password] The idea is to prevent the second scenario. by TheR -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] Re: How to manage data in MongoDB
http://docs.mongodb.org/ecosystem/tools/administration-interfaces/ by TheR -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] Assets compiler, how to copy whole directory to destination
How to instruct assets compiler to include whole directory in public/assets/somedir directory. The thing is with ckeditor which requires language dependent file at runtime. And if it doesn't find it in assets/ckeditor/lang directory it doesn't run. I have copied directory manualy for now. But can it be done and how by assets compiler. by TheR -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] Adding paths inside rails engine
In a application I am working on I have added forms path to app path where I keep my app specific forms. My application searches if file is present inside my app/forms folder or any other forms folder which can be added later. In order this to work I have added: config.paths["forms"] = Rails.root.join('app/forms') to application.rb I am in the process of transforming part of application to engine. According to what I have found yet this should work: my_app/lib/my_app/engine.rb module MyApp class Engine < ::Rails::Engine paths["forms"] = File.expand_path("../../../app/forms", __FILE__) p paths end end p paths actually shows that path["forms"] is added to paths, but after that in my application if I do: p Rails.configuration.paths doesn't include it. What am I doing wrong? by TheR -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] Re: Rails engines question
I found it myself. 1. Rails.configuration.paths["forms"] 2. I did my own method for now. def find_form_file(form) Rails.configuration.paths["forms"].each do |path| f = "#{path}/#{form}.yml" return f if File.exist?(f) end p "Form file #{form} not found!" nil end by TheR -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] Rails engines question
I would like to use my own directory named forms inside my own engine. I know I can add it to loading paths like this in application.rb module MyAPP class Application < Rails::Application config.paths["forms"] = Rails.root.join('vendor/myapp/forms') end end or inside and can access it inside controller like this: MyAPP::Application.config["forms"] Which is a bit of a problem since my engine would have to know application name inside which it runs. So, my questions are: 1. Is there a better way to access config object?. Like session or params inside controller. 2. What Rails API method is used to search files for example in MyAPP::Application.config["views"] paths and returns name of file (view) if find. by TheR -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-talk@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[Rails] Re: Frames in Rails
This is what I am using in one of my projects. It should't be problem to make it in erb. def iframe_helper(if_name) opts = { controller: 'somectrl', action: 'index', id: @record.id, iframe: "if_#{if_name}" } html = "" html << < $(document).ready( function() { $('#if_#{if_name}').attr('src', '#{url_for(opts)}'); }); EOJS html.html_safe end -- In short: opts = Hash to make url to display in frame. iframe html code. if_name=name of iframe. javascript part which loads iframe code by calling url when document is loaded. You need jquery for all this to work. by TheR -- 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 move rails 3.2.8 project from ubuntu to windows7?
wpollans wrote in post #1090832: > Currently, I have xubuntu installed on a bootable 16gb usb drive - the > rails app lives on this drive. This is for the benefit of a friend that > uses a win7 laptop - she boots from the usb drive to run the rails app - > works fine. I would like to have this app run in windows, so she > doesn't > have to reboot to use it. I see that I can install rails via > rubyinstaller > (http://rubyinstaller.org/). > > QUESTION: Can I just copy the top-level rails application directory to > windows? Haven't tried yet - trying to get advice before I start 8-) > > Feel free to point me elsewhere > > Thanks It should work with webrick as server unless you use gems that need compilation and are platform specific. by TheR -- 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: Re: How to add additional path for views location
Jordon Bedwell wrote in post #1089073: > ```ruby > config.paths["app/views"].unshift(Rails.root.join("/vendor/myapp/views/myctrl").to_s) > ``` > > The to_s might not be needed, I don't quite remember if Rails will > work with Pathname on app/views or if it expects a string, but based > on it's output I would expect it to always want to work with a string. Thanks. It works now. It looks that path must exist to be included in the searched paths list. by TheR -- 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 add additional path for views location
Jordon Bedwell wrote in post #1089069: > On Fri, Dec 14, 2012 at 2:17 AM, Damjan Rems > wrote: >> How to add another path where views can be found. > > See: > http://api.rubyonrails.org/classes/AbstractController/ViewPaths/ClassMethods.html#method-i-prepend_view_path > > ```ruby > MyController < ApplicationController > prepend_view_path "#{Rails.root}/vendor/myapp/views/myctrl" > end > ``` > > OR in your configuration you can apply it globally: > > ```ruby > config.paths["app/views"].unshift("#{Rails.root}/vendor/myapp/views/myctrl") > ``` I forgot to add that I use rails 3.2.9 Second one is not working too. Missing partial testing/index with {:locale=>[:sl], :formats=>[:html], :handlers=>[:erb, :builder, :coffee]}. Searched in: * "//rails/testapp/app/views" * "//rails/testapp/vendor/ruby/1.9.1/gems/kaminari-0.14.1/app/views" althow debuging shows that path is added to config.paths["app/views"] array. by TheR -- 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 add additional path for views location
How to add another path where views can be found. I have an app located in Rails.root/vendor/myapp and have Rails.root/vendor/myapp/views/myctrl folder for view templates. It can be done by render :file , but it is ugly. How can I add my views path to paths list where it would be automatically found by Rails controller. by TheR -- 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] Solved: Troubles with bcrypt-ruby
It turned out the problem was in controller code. ActiveModel::SecurePassword implements password= method, which is used to set password_digest field. so: calling record.password= sets password_diggest field. But as I have written I am using my own form system, which uses single controller for editing all models. I had something like this in the controller: fields.each do |k,v| @record[v['name']] = params['record'][v['name']] end which leads to when v is 'password' @record['password'] = params['record']['password'] which works perfectly OK with mongoid and adds password attribute to document. And of course doesn't call @record.password= method at all. Solution is to use send("password=", value) method of @record. @record.send( "#{v['name']}=", params['record'][v['name']] ) Hope this will save somebodies hours in future. by TheR -- 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: Coupure de connexion entre Rails 3.2.7 et Postgres 8.4
I google translated what you have written and as I understand database connection is not a problem. After some time your query returns nil for where should have been same data. You could try newer Postgress. 9.2 is the latest. Search logs for strange errors. This line: time = (Parameter.find(:first, :conditions => ["name=?", "login_error_wait"])).value can be done differently in 3.2.7 and I can also advice you this: t = Parameters.where("name" => "login_error_wait").first if t.nil? do some debugging end time = t.value by TheR -- 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: OLE2 signature is invalid
fahim patel wrote in post #1077636: > I am getting this error while using spreadsheet_on_rails Are you opening xlsx files instead of xls? by TheR -- 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: Troubles with bcrypt-ruby
Attached is the generated html source code. Thanks for any help TheR Attachments: http://www.ruby-forum.com/attachment/7745/myuser_form.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 https://groups.google.com/groups/opt_out.
[Rails] Re: Troubles with bcrypt-ruby
Colin Law wrote in post #1076008: > Have you remembered to add the password_digest field to the table? > > Colin Have you even tried to look at the code supplied ;-( Code represents a simplified model that I run test on and it also does not work. I don't think that adding few pages of code would be of any help. by TheR -- 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: Troubles with bcrypt-ruby
> This may be related: > http://reservedwords.herokuapp.com/words/records?q[word_or_notes_cont]=record > > Walter Nope. I checked by TheR -- 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] Troubles with bcrypt-ruby
I am trying to set password with bcrypt-ruby and mongoid but whatever I do I get "Password digest can't be blank". # Model class User include Mongoid::Document include Mongoid::Timestamps include ActiveModel::SecurePassword field :first_name, type: String, default: '' field :last_name, type: String, default: '' field :password_digest, type: String has_secure_password attr_accessible :name, :password, :password_confirmation end # Form part Password: Password confirmation: - I have tried a lot. Funny thing is that editing or adding user with rails console works OK. One possible problem is that I have my own form system and I always use name "record" for table name (instead of user in the case). Help please. by TheR -- 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: Taking about a minute do display error in development
Colin Law wrote in post #1075319: > On 10 September 2012 12:11, Damjan Rems wrote: >> There is no special error but any program error that may occur. It just >> waits minute before program error is displayed. Be it in controller or >> view or helper. > > Do you mean syntax errors, ruby run time errors, data validation > errors? Please show an example and post the section of > development.log that relates to the error. > > Colin Thanks. It is typical situation when you tell a problem to a friend the problem resolves itself ;-) I had installed ExceptionNotifier recently and the darn thing is now sending messages also in development environment. And since my development server is not on the same firewall segment as production the message could not be sent. And there was delay. I didn't recognized error until I tried to copy whole development log and find mail sending error at the top. thanks TheR -- 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: Taking about a minute do display error in development
Gintautas S. wrote in post #1075315: > sleep 60 somewhere in the code? > > 2012/9/10 Colin Law ;-) -- 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: Taking about a minute do display error in development
Colin Law wrote in post #1075314: > On 10 September 2012 11:47, Damjan Rems wrote: >> All of the sudden it takes about a minute to display error in >> development environment. Server just waits a minute before displaying >> standard error message. > > What is the error message? > > Colin There is no special error but any program error that may occur. It just waits minute before program error is displayed. Be it in controller or view or helper. -- 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] Taking about a minute do display error in development
All of the sudden it takes about a minute to display error in development environment. Server just waits a minute before displaying standard error message. I have no idea what could cause a problem. by TheR -- 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 update a table which is connected with joins
How about: http://abdul-barek-rails.blogspot.com/2009/12/how-to-execute-sql-query-in-rails.html I didn't tried it, but you may probably write Students.execute('update anytable set .') by TheR -- 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] delocalize gem problem
I am having problems using delocalize gem (which comes very handy btw). # with delocalize p Time.now, Time.current 2012-06-12 14:23:17 +0200 Tue, 12 Jun 2012 12:23:17 UTC +00:00 Result seen on input field: 12.06.2012 12:23 (date format is %d.%m.%Y %H:%M). It should be 12.06.2012 14:23. #without delocalize Result seen on input field: 2012-12-06 14:23:17 which is OK except that now date format is wrong which was the reason why use delocalize at first place. Rails 3.2.5 Ruby 1.9.3p0 Using delocalize (0.3.1) Ubuntu 12.04., /etc/timezone Europe/Ljubljana Does delocalize have any options which could solve the problem? by TheR -- 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: beginning_of_month problem
Colin Law wrote in post #1056120: > On 12 April 2012 09:36, Damjan Rems wrote: >> 22:00:00.00' and date < '2012-04-30 22:00:00.00') >> >> Which is wrong. Dates should have been 2012-04-01 00:00:00.00 and >> 2012-05-01 00:00:00.00 >> >> What is wrong? > > Nothing is wrong. Those dates are the beginning of the month for the > timezone that t is in, converted to UTC as times in the database are > in UTC. In order to get the result you expect then make sure that t > is a UTC time not a local time. > > Colin Thanks for this one. The problem lies one line before: t = Time.new(params[:year].to_i, params[:month].to_i, 1) And If I use: t = Time.utc(params[:year].to_i, params[:month].to_i, 1) it works OK. Is this a problem of database settings or local server settings or it's the only right way to do it? by TheR -- 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: beginning_of_month problem
Peter Hickman wrote in post #1056106: > Time zones :( But how can I avoid this? by TheR -- 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] beginning_of_month problem
Rails 2.3.2, Ruby 1.9.3 I want to get all records for one month from charges table. recs = Charge.where(["date >= ? and date < ?", t.beginning_of_month, t.next_month.beginning_of_month]) and this transforms into this query on PostgreSQL SELECT "charges".* FROM "charges" WHERE (date >= '2012-03-31 22:00:00.00' and date < '2012-04-30 22:00:00.00') Which is wrong. Dates should have been 2012-04-01 00:00:00.00 and 2012-05-01 00:00:00.00 What is wrong? by TheR -- 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: paginate with multiple criteria
Christopher Jones wrote in post #1054663: > I have pagination on my users table at the moment which works fine as I > only have one search feature for users. > > But I now wish to add pagination to my games table but not sure how to > implement it as I have 5 search features for games. I was wondering how > I would go about adding the pagination to the following controller > method. > > def index > @games = Game.gamsearch(params[:gamsearch]) > @games = Game.consearch(params[:consearch]) if > params[:consearch].present? > @games = Game.gensearch(params[:gensearch]) if > params[:gensearch].present? > @games = Game.where("game_name LIKE ?", "#{params[:game_name]}%") if > params[:game_name].present? > @games = Game.where("console = ?", params[:console]) if > params[:console].present? > > end I would take apart where clause and execution part. where = 'whatever comes here' if params[:consearch].present? where = 'something else' if params[:gensearch].present? etc ... @games = Game.where(where).page(params[:page]) . by TheR -- 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] Agregate (sum) by date
I need to sum some data for each day, but SQL is very poor standardized when converting time or date to string. For example these are two queries that do same thing in sqlite and postgres (and mssql has way different approach too) pgsql = <= '#{date_from}' and to_char(time_created,'MMDD') <= '#{date_to}' group by to_char(time_created,'MMDD') order by mydate esql sqlite = <= '#{date_from}' and strftime('%Y%d%m',time_created) <= '#{date_to}' group by strftime('%Y%d%m',time_created) order by mydate esql Is there a better way of doing this. by TheR -- 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] Stuck on "No route matches" when porting to rails 3.0
I don't do anything special. This default route setting should work. But it doesn't. Portal::Application.routes.draw do |map| map.root :controller => "portal", :action => "logout" map.connect ':controller/:action/:id' map.connect ':controller/:action/:id.:format' end I am also not able to install rails_upgrade plugin due to some problems with gem versions so I don't know if any other changes should be done to controllers in order to work. by TheR -- 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 and PostgreSQL ???
chris wrote: > Please post database.yml file and any errors in development.log. It > does work fine, postgres is my fav database for AR production: adapter: postgresql database: myportal username: usr password: pwd host: myhost development: adapter: sqlite3 database: db/development.sqlite timeout: 5000 charset: UTF8 test: adapter: sqlite3 database: db/test.sqlite timeout: 5000 charset: UTF8 oracle: adapter: oracle database: srv/instance username: usr password: pwd encoding: utf8 This is my database.yml. I use sqlite for test and development and postgres in production for my main db. I also need data from some tables located in oracle. Here is how you write model for table in oracle db: class Ora_client < ActiveRecord::Base establish_connection(:oracle) set_table_name "klients_table" 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: What's the right adapter to use for SQL Server?
> So my questions are: > > 1. Has anybody else had a similar problem? > 2. What database adapter is the proper one to use with SQL Server? > > Thanks in advance! > Norm I am using only simple access to MS SQL I also find out how to call procedures. No problems so far. ODBC is the only working way. Be it on Windows or Linux. Although it is not so trivial to install support on Linux it can be done (I am the proof ;-) Search for "ruby odbc freetds" on google. by TheR -- 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 instalation under Windows - problem
Jan Kunes wrote: > Hi Rajeev, thanks. You helped me a lot. Now I have running Instant > Rails, but how to force it to work together with some IDE (Aptana, > Netbeans)? Error messages like "wrong gems, cannot launch mongrel server > etc." appear when I'm trying to run sample application inside these > tools. I am using Netbeans all the time, but never come to mind using build in application server. I simply start DOS (command) window, cd to root directory of your app and run: ruby script\server This will run webrick or mongrel if it is installed. by Ther -- 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: SQLServer on Rails
Leonardo Mateo wrote: > On Sun, Jan 3, 2010 at 4:10 PM, steve wrote: >> Does any one know how to setup SQLserver with ruby1.9. �It was working >> on an earlier version and now nothing works! �I have installed the >> gems dbi ,dbd-odbc and activerecord-odbc-adapter and can connect in >> straight Ruby. �However, using rails with database.yml nothing works! >> I hosed everything and reinstalled rails and now, I get Win32/Parite >> virus on ruby.exe. �Any ideas? �I'm losing confidence on open >> source.. > Ha! really? > Poor you, go for a paid solution then. It looks you need some teaching about manners. To Steve: Is there any particular reason why do you need ruby1.9. I also had lots of problems with 1.9 on Windows and went back to 1.8.6 where everything works fine. Don't fix if it aint broken. by TheR -- 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 exit rails application from within
chris.reis...@gmail.com wrote: > On Oct 13, 11:56�am, Damjan Rems > wrote: >> >> >> -- >> Posted viahttp://www.ruby-forum.com/. > > If you are running inside mongrels with monit I am sure you could > really do this quite easily... > > controller: > def restart > `sudo monit restart -g mongrel all << server_sudo_password` > end > > view: > <% link_to "Restart", :action => :restart %> > > Of course because you CAN do something does not mean you SHOULD... > requires you put the sudo password in the code BAD BAD... > > I have not tested it, because my dev system is not setup this way. > but looks like it would work. Sadly my server is Windows. I am working on an application for internal users which runs Word and Excel with ole automation a lot to provide output documents in pdf. I haven't yet had production loads but a lot of things can go wrong when running ole automation. So I thought If I could close session and restart it on demand ( You can always repair windows by restarting it ;-) I thought that Mongrel or Webrick have some interface to end itself. Thank you TheR -- 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 exit rails application from within
Is the kill from outside application the only solution? by TheR -- 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 exit rails application from within
pepe wrote: > What do you mean by "restarting" the application? Do you mean end the > session (if any) and (re)display the login/index/initial page? > > If you need to end a session you can do it with this: > > reset_session > > To send a user to the login/index/initial page you can just use a > redirect: > > redirect_to :controller => 'my_controller', :action => 'my_action' > > Both things are done in your controllers. > > On Oct 13, 3:19�am, Damjan Rems I would like to quit (kill) session. Just like pressing Ctrl+C. by TheR -- 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 exit rails application from within
I would like to restart my rails application from within application. On demand. But I am stucked on first step. How to exit. exit 0 doesn't work. I am running webrick or mongrel. by TheR -- 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: Need Help! after upgrade rails to 2.3.2 it show empty p
I found this when creating new 2.3.2 application in routes.rb. # You can have the root of your site routed with map.root -- just remember to delete public/index.html. # map.root :controller => "welcome" by TheR -- 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: Read email in ruby
Remco Swoany wrote: > Hi, > > We receive from our partner notification emails. My idea is to insert > this email in our database. > > Ideas/links for reading emails in ruby? > > Grtz..remco This will be a good start unless you don't have imap mail server. http://www.ruby-forum.com/topic/111803 by TheR -- 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 save german date text_field in database
Herman Müller wrote: > Hi Damjan, > Hi Mike, > > I made a helper according to the Railscast Nr. 32 "time in textfield" > and played on Mikes advice a little bit with the Date Object and hurray > it works. > > def date_test_string > date_test.strftime('%d.%m.%Y') > end > > def date_test_string=(date_test_str) > self.date_test = Date.strptime(date_test_str, '%d.%m.%Y') > rescue ArgumentError > @date_test_invalid = true > > end > > def validate > errors.add(:date_test, "is invalid") if @date_test_invalid > end > > @Damjan: > > The example you wrote, what you mean with: > > update_date(:doc, :time_created, :time_closed)etc. > > are that the date-attributes inside the model > > like <%= f.text_field :date_test %> ? > > Regs > > Herman Yes. I prefere: <%= text_field :doc, :date_test %> or in my case I use calendar_date_select <%= calendar_date_select :doc, :time_closed, :time => true, :size => 15 %> update_date method will update params[:doc][:time_created] and params[:doc][:time_closed] fields. You call it before updating fields in a model with values obtained from browser. def save @doc = Doc.find(params[:id]) update_date(:doc, :time_created, :time_closed) if @doc.update_attributes(params[:doc]) ... ... end by TheR -- 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 save german date text_field in database
Herman Müller wrote: > Hi Ruby Comunity! > > To display a database stored date like %Y-%m-%d into a text_field with > german format %d.%m.Y. is not so difficult. For conversion you can do > something like > > <%= f.text_field :date_test, :value => > @tbl_datum.date_test.strftime('%d.%m.%Y')%> > > or use a helper. > > But how can I save it from the form back INTO the database. > > I tried it like in Rubycast Nr. 32 "time in textfield" but I think it's > not the same because you have to convert the date first from %d.%m.%Y to > database format%Y-%m-%d. > > I tried many (3-days long), but nothings work. > > Can somebody help me please, I'm really desperate:-( > > Thanks ahead for every proposal! > > Regs, > > Herman This is how I do it. Unless until I digg into i18n Put into application.rb def update_date(*args) rec = args.shift args.each do |e| d,m,y,time = params[rec][e].split(/\.| /) params[rec][e] = y + '-' + m + '-' + d + ' ' + time unless y.nil? end end Then call: update_date(:doc, :time_created, :time_closed) before you update attributes in your controller. by TheR -- 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 make my own render method
I would like to create method to render for my own format. What I would like to accomplish is something like this: respond_to do |format| format.html format.pdf { render :file :=> 'my_file' } end Where format.pdf is what I would like to accomplish. I guess I must do two things: 1. Register new format (format.pdf) 2. Implement rendering method. Can someone please direct me where should I begin. I don't seem to find any good (easy) directions on the net. by TheR -- 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: List of databases supported by Rails
Peter De Berdt wrote: > On 25 Mar 2009, at 10:20, Damjan Rems wrote: > >> Where can I obtain list of databases supported by Ruby on Rails? > > http://wiki.rubyonrails.org/#database_support > > > Best regards > > Peter De Berdt Thanks. I have also find this which adds some more. gem list --remote --source=http://gems.rubyonrails.org *** REMOTE GEMS *** actionmailer (2.2.0) actionpack (2.2.0) activerecord (2.2.0) activerecord-firebird-adapter (1.0.0.9250) activerecord-frontbase-adapter (1.0.0.9250) activerecord-informix-adapter (1.0.0.9250) activerecord-openbase-adapter (1.0.0.9250) activerecord-oracle-adapter (1.0.0.9250) activerecord-sqlserver-adapter (1.0.0.9250) activerecord-sybase-adapter (1.0.0.9250) activeresource (2.2.0) activesupport (2.2.0) rails (2.2.0) by TheR -- 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] List of databases supported by Rails
Where can I obtain list of databases supported by Ruby on Rails? Thanks TheR -- 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: Where is my message
Frederick Cheung wrote: > On Mar 20, 6:46 Damjan Rems > wrote: >> Yes where my program is doing control, but this is ROR's buildin method. >> Where does it put the message? >> > Sorry, without seeing some code I'm not at all sure what you're on > about. > > Fred Nevermind. I found out that it is in AR model errors method. In my case @mailadress.errors thanks anyway by TheR -- 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: Where is my message
Frederick Cheung wrote: > On Mar 19, 1:38�pm, Damjan Rems > wrote: >> >> p flash returns {} >> > Are you putting an error message in the flash ? > > Fred Yes where my program is doing control, but this is ROR's buildin method. Where does it put the message? by TheR -- 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] Where is my message
I am using this model validation: class Mailadress < ActiveRecord::Base belongs_to :maillist validates_size_of :desc, :maximum => 50, :message => 'Description too long!' end When I try to update with inproper size update fails but where is the error message. p flash returns {} Rails is 2.2.2. by TheR -- 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: I have many Rails 3.0 questions here....
The way I understood the majority of code will run happy and unchanged under 3.0. There will probably be some lines of code that will have to be changed or could be minimized and still work as expected. There will also be some gems and plugins which will have to be updated to work properly with the last version (which is nothing new, happens with every minor version). The main idea of merging two projects was to bring the best of both worlds to users and not to provoke another fork because of too many changes. If you have time learn both and choose the one it suits you best when you will have a project. I personaly would learn Rails. by TheR -- 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 there plan for rails 3.0 based on merb?
My colegue once sad. Where there are more solutions none of them is good, because if one was good enough no one would use anything else. (I guess he didn't heard for democracy at the time ;-) It is great news to hear that two (nonperfect) solutions are about to merge to make a better world for all of us, Ruby lovers. We just hope that spirit of the christmas time will extend to new year when the work will have to be done. Marry Christmas and a happy new year to everyone by TheR -- 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] State of Ruby and ROR
New year is comming and I would like to clear some questions on the future of Ruby and ROR. 1. We see that Ruby 1.8.7 is default on ubuntu 8.10. In the past there were problems with ROR and ruby 1.8.7. Have this problems been resolved? 2. Short after New year Ruby 1.9 will be considered stable and the question is Is ROR ready for Ruby 1.9 and are there any speed in improvments? by TheR -- 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: rails - 2 buttoms on a FORM
I guess you want to diferenciate clicks to different submit buttons. I did it like this: <%= image_submit_tag('add_16.png', :name => "action_categories/new") %> By specifiing name you can differenciate in controller which button was selected. params.each do |e| if e[0][0,7] == 'action_' ctrl, action = e[0][7,100].split('/') action ||= 'index' break end end The example shows which controller/action call when submit button is pressed. by TheR -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] Re: SQL question
Pau Cor wrote: > This isn't exactly the same, but it might be good enough for you: > > select id from docs where title like '%en%' or body like '%en%' > > There is an SQL validator here: > http://developer.mimer.com/validator/parser200x/index.tml Of course. Sometimes you just have to break the problem into smaller peaces. Althow I will have to do some research about performance (>> 1 records). It should even be faster if string is found in title. Thank you also Phillip. There is so much I have to learn about AR. In the mean time I have found that this: select id from docs where title || body like '%en%' works on PG3.3, sqlite3, Oracle 10. But of course not on MS-SQL2005. by TheR -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---
[Rails] SQL question
This works as expected in sqlite3 select id, title || body as tb from docs where tb like '%en%' But fails in postgres because tb is unknown. and works in ms-sql like: select id from docs where title+body like '%en%' I didn't tried Oracle but I guess it has its own sintax too. So my questions are. 1. Is there universal SQL syntax to support this query? 2. (whispering) Could it be done in rails (AR) syntax? 3. Should I create a view and query the view? by TheR -- 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~--~~~~--~~--~--~---