Rodrigo Alves Vieira wrote in post #1017309:
> Hello everyone, I'm using a gem called aws-ses and I'm trying to
> sophisticate the email I am sending, here is the code currently:
>
> ses = AWS::SES::Base.new(:access_key_id => 'foo', :secret_access_key =>
> 'bar')
>
>
> email ={
> :to => "#{subscr
I am currently using Rails 2.3.5. I installed will_paginate gem 2.3.16
as suggested in the will_paginate github page. But will_paginate is
not being recognized when I use it and I always end up with an
error.The following are the error when used from the project console
and have also included my ge
On 19 August 2011 10:47, Annapoorna R wrote:
> hi all,
> i am tryin to develop a blog in rails3...that should have all the basic
> functionalities of blog like *creating a article *,*posting* ,*comments
> *can anybody help me with this to start from the scratch.. is there any
> plugin to be insta
Can anyone shed some light on 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 e
hi all,
i am tryin to develop a blog in rails3...that should have all the basic
functionalities of blog like *creating a article *,*posting* ,*comments
*can anybody help me with this to start from the scratch.. is there any
plugin to be installed?
--
You received this message because you are subs
You should be doing this in the model, not controller.
If you want to do this everytime the user record is saved, then define a
before_save callback in your model and add this in the method
def udpate_result
self.result = self.height*self.weight
end
Note: You will have to convert height and wei
Try this
:unless => Proc.new {|user| user.password.nil?}
Essentially it will check if you are sending a password attribute to the
user or not while updating the user record and will check for this
validation only if password attribute is present.
Chirag
http://sumeruonrails.com
On Thu, Aug
Hello!
Dreaming about Drag and Drop for Nested Sets? It’s should be with
JQuery?
Here’s the solution!
https://github.com/the-teacher/Sortable-Nested-Set
Installing
cd ~
git clone g...@github.com:the-teacher/Sortable-Nested-Set.git
cd Sortable-Nested-Set/
sudo bundle install
I solved this using content_for. I put everything in the first
fields_for but the fields I wanted to move to a different partial, I
placed in the content_for block. See the example below.
Hope this helps,
Matt
# example
<%= f.fields_for :cars do |car_fields| %>
<%= car_fields.label
Okay. But I am a beginner too, so I don't know if this is the best way.
I'm assuming the path to your folder is:
/public/files_to_read
class PagesController < ApplicationController
def home
@title = "Home"
end
def get_files
dir_path = 'public/files_to_read'
Dir.chdir(dir_pa
I have had good success using the net-ldap gem
(http://rubygems.org/gems/net-ldap). Though you will need to map the attribute
values to your model by hand.
Long
--- On Thu, 8/18/11, Beerlover88 wrote:
From: Beerlover88
Subject: [Rails] LDAP Models
To: "Ruby on Rails: Talk"
Date: Thursday, Au
Devise + LDAP is a good idea to do it
https://github.com/cschiewek/devise_ldap_authenticatable
2011/8/18 Beerlover88
> I'm running Rails 3.09/Ruby 1.8.7, and I'm looking for some advice on
> how to create models from LDAP servers. I see there is an ActiveLDAP
> gem floating around out there, bu
Thank you everyone, and that link helped me with git.
Well, setting aside the code access concern, the other thing I wanted to
know is how to work in a team with rails, and I mean, how should I split my
project?
For example, one member will do the Controllers, other will do the Models,
other will
On Thu, Aug 18, 2011 at 11:09 PM, Rodrigo Alves Vieira
wrote:
> Hello everyone, I'm using a gem called aws-ses and I'm trying to
> sophisticate the email I am sending, here is the code currently:
>
> ses = AWS::SES::Base.new(:access_key_id => 'foo', :secret_access_key =>
> 'bar')
>
>
> email ={
>
On Thu, Aug 18, 2011 at 4:57 PM, Marc Chanliau wrote:
>> Your question is really a rubygems question, so posting it in the main
>> Ruby forum is more appropriate.
>
> I posted there without any success, which is why I tried this topic
> list.
What would you call "success"? I responded to your ru
Hi guys,
I have the following problem:
In my application there is 3 entities that have this relationship:
-1 post has many comments
-1 comment belongs to one user and to one post
-1 comment could be voted by many users
My problem is how can I make a query to search for the best rated
comment, in ot
Do you have installed the libmysqlclient?
If not, install the libmysqlclient and reinstall the mysql gem.
2011/8/18 Marc Chanliau
> 7stud -- wrote in post #1017183:
> > Also, if you post your question plus the 'gem environment' output in the
> > Ruby forum, they will be able to pinpoint what
7stud -- wrote in post #1017183:
> Also, if you post your question plus the 'gem environment' output in the
> Ruby forum, they will be able to pinpoint what is going on very quickly.
> Your question is really a rubygems question, so posting it in the main
> Ruby forum is more appropriate.
I posted
7stud -- wrote in post #1017182:
> Do you have mysql installed? mysql and the ruby mysql adapter are
> different things.
Yes of course! And I have a database ready to be used with an
activerecord application.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you
Spent a few hours looking through RoR sources and seems like i found
some kind of solution:
If we override property @_model_name in our models we can strip out
"Gallery::" from it:
class Gallery::Gallery < ActiveRecord::Base
@_model_name = Gallery.model_name(self)
end
And in module:
module Gal
More examples:
Save any pure Ruby object (also complex & nested) in MongoDB
https://github.com/alexeypetrushin/mongo_db
+ driver API enhancements (100% backward-compatible with original API),
makes API more friendly & handy, no extra abstraction or complexities
introduced, all things are exact
On Thu, Aug 18, 2011 at 2:51 PM, Colin Law wrote:
>> customer.firm.name I got error.
>
> <%= customer.firm.name if customer.firm %>
>
> Or possibly better to provide a method, say firm_name, of Customer
> that tests self.firm and returns the name or nil or maybe a default
> string if that is what
Tim Shaffer wrote in post #1017353:
> <%= prints the contents of the tag,
Well, it never meant that. <%= tells ruby to print the result of the
expression between the tags. For instance,
<%= 2+2 %>
would not print '2 + 2', it would print '4'. But even the "result of
the expression" isn't an
On 18 August 2011 21:58, Dorijan Jelincic wrote:
> Hi...
> I have 2 tables, connected with belongs_to and has_one and everything
> works ok until I get one entry in base where I dont have set id of
> belongs_to entry. How can I prevent it(except that that all entry has
> ids :) or dont print anith
I fixed it. Here was the problem.
In my JavaScript include lines I had this:
<%= javascript_include_tag :defaults, 'scriptaculous', 'prototype',
'effects', 'controls', 'date-picker', 'jquery', 'jquery.min',
'application' %>
// Don't take this out as long as you are using the jQuery and
S
Hi all,
I have this rails website that works fine, but I wanted to experiment
with jQuery a little so I added all the necessary file to my JavaScript
folder and, well, all hell broke lose in that adding jQuery causes
Scriptaculous/Prototype not to work while jQuery works kinda-fine. Doing
a search
On Aug 18, 2011, at 2:25 PM, Rodrigo Alves Vieira wrote:
Hello everyone, how can I get all available urls of my application,
I don't mean rake routes I mean some code that returns literally all
the urls (or paths)
for example
let's say it's a blog application, with this code I should be a
Hi...
I have 2 tables, connected with belongs_to and has_one and everything
works ok until I get one entry in base where I dont have set id of
belongs_to entry. How can I prevent it(except that that all entry has
ids :) or dont print anithing in view?
this is what I am talking about:
I have custom
And you couldnt just try that out yourself? :D
On Aug 18, 7:39 pm, Pepe Sanchez wrote:
> Hi all
>
> what is the difference between <%= and <% in a view file?
>
> thanks
>
> --
> Posted viahttp://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "
Could you provide a code example of the connection between the links
and an action that sends the file? I now have a list of links on a
page but clicking them gives:
"Firefox doesn't know how to open this address, because the protocol
(c) isn't associated with any program."
Thanks,
Barney
> On a separate issue, looking at the message you get, are you using
> ruby 1.9.1? If so then upgrade to 1.9.2 or go back to 1.8.7, ruby
> 1.9.1 does not work reliably with rails. This may have nothing to do
> with your problem.
>
No, I'm using ruby 1.9.2
> I note that you still have not an
I'm running Rails 3.09/Ruby 1.8.7, and I'm looking for some advice on
how to create models from LDAP servers. I see there is an ActiveLDAP
gem floating around out there, but it's Rails 3 support is only for
3.1rc4. Specifically, I'm trying to compare my user base on one LDAP
server to another LDA
The long-awaited release of Fedena 2.1 is now available at Project
Fedena. There are lot of new features added and all the identified
issues of version 2.0 is resolved in this release.
Official Blogpost - http://blog.foradian.com/fedena-21-is-released
Github - https://github.com/projectfedena/fede
> On a separate issue, looking at the message you get, are you using
> ruby 1.9.1? If so then upgrade to 1.9.2 or go back to 1.8.7, ruby
> 1.9.1 does not work reliably with rails. This may have nothing to do
> with your problem.
>
I'm using ruby 1.9.2
> I note that you still have not answered
done.
example how do that.
after_filter :write_file
def index
end
protected
def write_file
File.open('public/test.html', 'w+') do |f|
f.write response.body
end
end
On Aug 18, 5:41 am, Shukhrat Tursunov wrote:
> Hi
>
> I have a question
> when you open page from brow
Hello everyone, how can I get all available urls of my application, I don't
mean rake routes I mean some code that returns literally all the urls (or paths)
for example
let's say it's a blog application, with this code I should be able to see:
/
/about
/contact
/posts
/posts/2011-08-18
/posts/2
2011/8/18 Cássio Godinho :
> In a form I input height and weight values and want to multiply those two
> values and store on the resulta row on database. I was trying something like
> that
> def criar
> @user = User.new(params[:user])
> @result = @user.height * @user.weight
>
Lets supose I have a User table, and on this table I have height, weight and
result rows.
In a form I input height and weight values and want to multiply those two
values and store on the resulta row on database. I was trying something like
that
def criar
@user = User.new(params[:use
<%= prints the contents of the tag, whereas <% does not
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/DImbzNgRNCYJ.
To post to this group, send
Hello!
I've got Gallery resource with namespaces:
/gallery/galleries_controller.rb
/gallery/albums_controller.rb
/gallery/photos_controller.rb
and models Gallery::Gallery, Gallery::Album and Gallery::Photo in my /
models/gallery/ folder
I want my Gallery work like standart resource: site.com/gall
Nvm, the problem was with mongoid!
MODEL PRELOADING
In order to properly set up single collection inheritance, Mongoid needs
to preload all models before every request in development mode. This can
get slow, so if you are not using any inheritance it is recommended you
turn this feature off.
conf
Hi all
what is the difference between <%= and <% in a view file?
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-talk@googlegroups.com
Can someone help me complete this piece of code?
I'm thinking about using :unless because the only place where I wouldn't
like the password validation is in the Edit User page.
validates :password,
:presence => true,
:length => { :minimum => 6, :maximum => 20, :message => 'should have
between 6
Hello Everyone,
I need some help related to the below requirements:
-> I need to setup production environment without installing Ruby or
Rails or other related gems into it.
I did accomplish the same using JRuby, bundler and warbler plugin. And
deployed the WAR file into Apache Tomcat server. But
Chirag Singhal wrote in post #1017338:
> There are few issue in this:
Thanx alot Chirag, let me try out your hints . Will get back to 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 pos
On 18 August 2011 16:52, himanshu soni wrote:
> "Tell us which school/organization you wish to support"
>
> The attached image is what the second line should look like -
> http://tinypic.com/r/2rehzlx/7
Is there a question there somewhere?
Colin
--
You received this message because you are sub
I temporarily solved the username attribute by not letting the user
update the username. So the validation only works :on => :create
So username attribute validation problem solved.
Now I got the password validation problem. Ok, it seems the problem was
kinda of obvious but I couldn't see it.
I
On 18 August 2011 17:48, Angelo Cordova wrote:
>
>> >> > I tried this
>>
>> >> > def before_create
>> >> > debugger
>> >> > stg = Storage.create!(:product_id =>
>> >> > self.product_id, :current_quantity
>> >> > => self.quantity, :stg_data => purchase.prc_data)
>> >> > end
>>
>> >> > and
There are few issue in this:
1. You should not be doing sql queries directly from views, instead set the
instance variable in controller and pass it to view.
2. Your form is submitting to /course/show, instead it should be
/course/list
3. Controller name should be plural, you have got the name as C
> >> > I tried this
>
> >> > def before_create
> >> > debugger
> >> > stg = Storage.create!(:product_id =>
> >> > self.product_id, :current_quantity
> >> > => self.quantity, :stg_data => purchase.prc_data)
> >> > end
>
> >> > and when I "inspect" the variable "stg" I got "stg => nil" as
Got the same problem myself and I'm yet to crack it!
--
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 t
"Tell us which school/organization you wish to support"
The attached image is what the second line should look like -
http://tinypic.com/r/2rehzlx/7
--
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 rub
Hi, im new to rails and I got a mind boggling issue.
I have a select form populated with Institutes names e.g University of
Yale. These records are obtained from the Institute ActiveRecord.The
institutes table has a many to many relationships with the course table.
My application should work such
Correct url above should be
https://github.com/rails/rails/commit/0c57ae102f938b8f3d14d7cc37ab15b87bdaa4f5
--
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 unsubsc
I'm currently using Rails 3.1rc5, and deploy with capistrano. During
deploy, I precompile the assets on the server using assets:precompile
after deploy:symlink.
I noticed that "group :assets" gems in my gemfile were being included
in my production application processes (and adding a lot of memory
A classic HABTM!
Class User < ActiveRecord::Base
has_many :books, :through => :book_shelves
end
Class BookShelve < ActiveRecord::Base
belongs_to :user
has_many :books
end
Class Book < ActiveRecord::Base
belongs_to :user, :through => :book_shelves
end
You can get the list of books like so:
Hello!!
How can i disable the rails 3.1 in development mode from serving images?
I have some pages with tons of images and sometimes the page takes more
than 10 seconds to load...
Thanks!
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the
Hi,
I've been trying to read ActiveRecord tutorials etc. but haven't
figured out how to get the information I want. Let's say I have a
users who own one to many bookshelves and some of these bookshelves
contain books. Now I would like to get a list of books that belong to
user named Timeon:
SELEC
Hello!
I'm developing online game (Heroes fighting against Clans) and i'm
planning next structure of my app: i've got top-level resources Heroes
(profiles of supermembers) and Clans (profiles of groups of members).
So
i've got both HeroesController and ClansController.
What i wanna do is give Her
On Aug 17, 2011, at 7:38 PM, Philip Hallstrom wrote:
On Aug 17, 2011, at 3:32 PM, John Hinnegan wrote:
So I'm using a column in my database to serialize a hash of extra
data about an object. Stuff I'd want when displaying, but not
anything else I care to have structured access to in my D
On 18 August 2011 14:50, Angelo Cordova wrote:
>> > I tried this
>>
>> > def before_create
>> > debugger
>> > stg = Storage.create!(:product_id =>
>> > self.product_id, :current_quantity
>> > => self.quantity, :stg_data => purchase.prc_data)
>> > end
>>
>> > and when I "inspect" the varia
Hello everyone, I'm using a gem called aws-ses and I'm trying to sophisticate
the email I am sending, here is the code currently:
ses = AWS::SES::Base.new(:access_key_id => 'foo', :secret_access_key => 'bar')
email ={
:to => "#{subscriber.email}",
:source => "'#{ag.name}' '",
:subject =
Add a before_save filter and downcase/upcase/titleize them for
uniformity!
Walter
On Aug 18, 2011, at 10:22 AM, AppleII717 wrote:
Happens every time - I find the problem after the post.
In the rails 3.0 version I capitalized the roles.
In the rails 3.1 version I lower cased the roles.
One
Happens every time - I find the problem after the post.
In the rails 3.0 version I capitalized the roles.
In the rails 3.1 version I lower cased the roles.
One of the few things I hate about ruby/rails case sensitivity.
On Aug 18, 9:05 am, AppleII717 wrote:
> In my Users model I have
>
> seria
In my Users model I have
serialize :roles
Letting it default to yml
I enter roles as a text array. e.g.,
u.roles = ["member","scorer"]
It displays as an array
@user.roles.type returns Array
All is fine except if I try to use the select form helper to input the
values with multiple => true
> > I tried this
>
> > def before_create
> > debugger
> > stg = Storage.create!(:product_id =>
> > self.product_id, :current_quantity
> > => self.quantity, :stg_data => purchase.prc_data)
> > end
>
> > and when I "inspect" the variable "stg" I got "stg => nil" as result
>
> That is not su
On Aug 18, 2011, at 2:30 AM, Kapil K. wrote:
you told to me this solution
If you're using Paperclip or CarrierWave, just add two separate file
attributes to your base model, following the usual instructions for
either. If you want to be able to attach N number of files of any
format to a base
I changed Oniguruma::ORegexp.new with Regexp.new
for example contents.to_s.gsub!(regular_expression, replace text)
but it returns a nil value and does`nt seem to working as expected
like (<\/p>)\s+() for removing paragraph tags form the content
and i keep recieving this error message in the term
On 17 Aug 2011, at 19:23, Rodrigo Ruiz wrote:
> hi, I've started developing websites with rails about 3 months ago,
> and now I need to work with for people at the same project.
> How can I do that?
>
> first, I can't allow access of the entire code to everyone for security
> purpose;
> second,
On 17 Aug 2011, at 23:31, ADNAN TAHIR wrote:
> I want to use Faye on production server. how can I start faye server
> automatically or as a daemon process.
>
> Because when I start faye server using SSH it shutdown as i close ssh
> connection. Please guide me its really urgent.
>
> I can run fay
On Aug 18, 7:58 am, nishant wrote:
> So what are the changes i have make in my ruby 1.8.7 syntax to parse
> my regular expressions for ruby 1.9.2 , Can you provide me some kind
> of link.
I think it's all backwards compatible - your existing regular
expressions should still work, but you now al
Hi
I have a question
when you open page from browser
application renders the page and gives it to the browser
how do that in action and save render page in html file
Thanks!
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to thi
With the following code and result below, why does the cars_attributes
index (i.e. name=owner[cars_attributes][>>>0<<<][color]) increment in
the second fields_for block when only one car is built? Shouldn't it
stay the same because only one car was built?
Is this standard behavior? If so, what is
Hello! It seems I have the same bug in Rails 3.0.9...
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4896
Why? Was it a bug? Is it a bug?
Thank you!
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this g
Hello all,
I am trying to install the SequreISP application (link below) but I'm
facing an error that I cannot resolve and any help is much appreciated.
The application I am trying to install is:
https://github.com/sequre/sequreisp
Here's some information about my system:
OS: Centos 5.4 (Final)
I couldn't make it work with Admin:: namespace and submitted a bug
report:
https://github.com/rails/rails/issues/2572
Please comment.
Alexey.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
On 17 August 2011 17:45, Murtuza wrote:
> I am a newbie to Ruby on Rails.
> I created a new rails project, but when i go to that directory and do
> rails server to start the server, it asks me whether i want to
> overwrite config/initializations/session_store.rb
Which version of rails are you usi
On 17 August 2011 15:31, Angelo Cordova wrote:
>
>> Debugging will tell you whether the callback is being called. If you
>> assign the result of Storage.create! to a variable and break after
>> that then you will be able to inspect that object.
>>
> I tried this
>
> def before_create
> debug
Rodrigo,
take a look at "Distributed Workflow" section in Git Community Book:
http://book.git-scm.com/3_distributed_workflows.html
It is assumed there however that everybody in your project has access to
the
full code.
Alexey.
--
Posted via http://www.ruby-forum.com/.
--
You received this m
79 matches
Mail list logo