Marnen Laibow-Koser wrote in post #960256:
[...]
> This is the best stolidity I've been able to figure out.
iPhone autocorrect strikes again. I meant "atomicity", not "stolidity".
>
> Best,
> --
> Marnen Laibow-Koser
> http://www.marnen.org
> mar...@marnen.org
--
Posted via http://www.ruby-fo
Philip Hallstrom wrote in post #960209:
> On Nov 8, 2010, at 3:28 PM, Anthony Smith wrote:
>
>> My thought is that it verifies you're receiving the error you expected and
>> not
> an artifact from another issue. So my intention is not to test Rails but
> to make
> sure my tests are doing what I'm
Never mind, bitten by fixtures. They aren't created normally and the
callbacks aren't called.
Jeffrey
Quoting Jeffrey L. Taylor :
> I'm using Rails 2.3.5 and finding that for lines like these below in a model,
> the block is never executed. Am I doing something wrong or was this
> introduced in
On Mon, Nov 8, 2010 at 9:46 PM, David Kahn wrote:
>
>
> On Sun, Nov 7, 2010 at 7:51 PM, Ben Porterfield wrote:
>
>> I've just started a new rails project (3.0.1, ruby 1.9.2 on Mac OS X),
>> and have a few parts of it built out. I've just created new
>> controller/views using rails g scaffold_contr
On Sun, Nov 7, 2010 at 7:51 PM, Ben Porterfield wrote:
> I've just started a new rails project (3.0.1, ruby 1.9.2 on Mac OS X),
> and have a few parts of it built out. I've just created new
> controller/views using rails g scaffold_controller Lesson, and then
> added a route to routes.rb with "res
I am using the new validation class rails3 provides. The issue is it
keeps giving me an error in the whole app of:
:attributes cannot be blank
here is the class below. I commented out all of the code to do
anything but it still gives me the error. Ideas??
class FileUploadValidator < ActiveMo
It's even simpler than that. Chalk it up to a rails newbie - sorry for
the bother. Here's what I did:
Rails generated this:
# GET /appointments/1
# GET /appointments/1.xml
def show
@appointment = Appointment.find(params[:id])
respond_to do |format|
format.html # show.html.erb
With Rails 3, how do I create a "link_to" reference that uses a pre-
exisiting token value instead of the record id? Is there a way to use
the URLHelpers to do this, or do I need to use the old style "link_to"
syntax with action, controller, id etc? The documentation doesn't seem
to provide any poi
Hi All,
I am trying to send an email on a user sign up. The email is working
without any issues. However there is a problem with the :from field
that I am specifying. My SMTP setting look like :
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port
John Postlethwait wrote in post #915199:
> I found a way around this, though I still have no clue why this works:
>
> In my controller, if I add:
>
> def show
> end
>
> The before filter DOES NOT run, as I expect, as soon as I remove the
> def show;end the filter is once again applied to the #show
I'm using Rails 2.3.5 and finding that for lines like these below in a model,
the block is never executed. Am I doing something wrong or was this
introduced in a later version of Rails?
before_create :preprocess_score
def preprocess_score
puts "HERE: #{__LINE__}"
self['score'] = Toke
The solution is very simple:
@records = Record.paginate(
:page => params[:page] || session[:zb_page],# (2)
:per_page => limit)
session[:zb_page] = params[:page] if params[:page]# (1)
+ If a page was given, store it in the session cookie (1)
+ On paginateded find us
On Nov 8, 2010, at 3:28 PM, Anthony Smith wrote:
> My thought is that it verifies you're receiving the error you expected and
> not an artifact from another issue. So my intention is not to test Rails but
> to make sure my tests are doing what I'm expecting. Does that make sense or
> am I just
My thought is that it verifies you're receiving the error you expected and not
an artifact from another issue. So my intention is not to test Rails but to
make sure my tests are doing what I'm expecting. Does that make sense or am I
just paranoid?
On Nov 8, 2010, at 6:14 PM, Marnen Laibow-Koser
On Mon, Nov 8, 2010 at 5:01 PM, Anthony Smith wrote:
> For example:
>
> it 'should not validate if nil' do
> @account.name = nil
> @account.should_not be_valid
> @account.errors[:name][0].should eq 'can\'t be blank'
> end
>
I do - my discipline is whenever I am modifying a model I
Anthony Smith wrote in post #960202:
> For example:
>
> it 'should not validate if nil' do
> @account.name = nil
> @account.should_not be_valid
Those two lines are good practice: you're testing that the object is
invalid when you want it to be.
> @account.errors[:name][0].shoul
For example:
it 'should not validate if nil' do
@account.name = nil
@account.should_not be_valid
@account.errors[:name][0].should eq 'can\'t be blank'
end
Is this good practice?
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk"
On 8 November 2010 20:50, Frederick Cheung wrote:
> On Nov 8, 8:43 pm, Xdmx Xdmx wrote:
>> Hi guys, sorry the "spam",
>
> would have been less spammy if that link to appsumo.com didn't have
> what looks like a referral code embedded in it.
haha! yes...
http://tinyurl.com/35adxnv : 19 characte
On Nov 8, 8:43 pm, Xdmx Xdmx wrote:
> Hi guys, sorry the "spam", but I've just seen that there is a very good
> offer for us (ie. months of newrelic, sendgrid, heroku, linode and other
> cool services). You can check more here:http://tinyurl.com/35adxnv
> Hope that's useful for someone (I've jus
Hi guys, sorry the "spam", but I've just seen that there is a very good
offer for us (ie. months of newrelic, sendgrid, heroku, linode and other
cool services). You can check more here: http://tinyurl.com/35adxnv
Hope that's useful for someone (I've just took it)
--
Posted via http://www.ruby-for
You can try to run the command line as an Administrator. I had the
same problem when running on Windows 7
Linh Mai.
On Nov 5, 1:33 am, Anand Srinivasan wrote:
> Hi there,
>
> When using the mongrel_service in windows, I am getting an Access Denied
> error. I can understand that this is because o
I believe your problem is this:
Blog.comments.all
You want comments on a specific blog, so you need this instead:
@blog = Blog.find(params[:id])
@comments = @blog.comments
Hope this helps.
Jeff
purpleworkshops.com
On Nov 7, 2:56 pm, aperture science wrote:
> I am trying to add comments to m
On Nov 7, 10:57 pm, Samnang wrote:
> Do you any ideas on how to optimize this problem?
Does it need to be XML? JSON is much lighter and faster. You can
also use page caching with REST, so subsequent request is just like
Apache serving flat file. Maybe try to use some sort of compression
too?
If /public/ is an absolute path on your file-system, you can use the
standard Ruby File methods. If /public/ must be relative to your app,
use the standard File methods relative to Rails.root.
On Mon, Nov 8, 2010 at 10:13 AM, Pradeep Achuthan wrote:
> Hi,
>
> I have upgraded from rails 2 to rails
@phillip: thanks for the suggestions. Upon reflection, since the Google
geocoder is already set up for client-side javascript queries, that's
probably the best way to go.
- ff
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Group
Hello,
Without a few more details it's hard to say, so I'll make some assumptions:
* You have token based authentication.
* Your controllers and routes are already setup in a RESTful pattern.
* Serializing your models is not a big deal.
If these assumptions hold, all you need to is follow the pa
Quoting Samnang :
> Hi all,
>
> Currently, I'm developing a rails app that are heavy generating xml
> from restful webservice. My xml representation of web service use
> nokogiri gem to generates xml format that match expected format from
> client. But the problem is data is quite big around 50, 0
bertly_the_coder wrote in post #960002:
> I have been working with a couple of date operations in rails and my
> answers have been pretty consistently inconsistent. I am a bit puzzled
> about the difference between:
> 1) days_stat = user.daily_stats.where({:day => dte.midnight..
> (dte.midnight + 1
Answering the question #1 you can achieve this using the request.env[
'HTTP_HOST' ] variable, that will return you a string with the hostname
and the listening port, something like 'localhost:8080'.
For the second one, I guess you could create like some constants for
storing those keys of your n
That did the trick! I just converted over to Rails 3 so I wasn't aware
of the Gemfile requirement. smbepiec, thanks for the suggestion -- it
will come in handy when I update to Ruby 1.9.2.
Arzumy MD wrote in post #960061:
> In Rails 3 you need to include the gem in Gemfile
>
> gem 'ruby-debug'
>
Jeffrey L. Taylor wrote in post #960038:
> Quoting Marnen Laibow-Koser :
>> > of
>>
>> Composite *primary keys* are not (but there's a plugin). Composite
>> *indices* are. You can specify multiple columns in add_index.
>>
>
> Sorry I left out a constraint that turned out to be critical. This is
pepe wrote in post #960118:
>
> I am guessing that you are planning on using later on the message that
> you are raising. Why not just add the error to your memo object errors
> and then check in your controller if your memo.errors is empty or not?
>
> pepe
Thanks for both suggestion. Again, first
Hi,
I have upgraded from rails 2 to rails3... I wanted to know to know how
to open a file and write it in a location
for eg.. i need to save a image in /public/imag...@imagename..
Please help me.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribe
Was this ever solved? How do I load a UTF-16 xml file into REXML?
Thanks!
Naren
--
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...@googlegroup
On 08/11/10 14:44, h0bit wrote:
//document.getElementById("Longitud").innerHTML =
marker.getPosition().lng();
//document.getElementById("Latitud").innerHTML =
marker.getPosition().lat();
I think you just have to uncomment these lines and add some html like:
Longitude:
My advice to you is to use mysql instead of sqlite and see the results
as it is a sample app. If not, try to be a little through about sqlite
before using. moreover mysql and postgre are widely used DBs and will
help you in future.
--
Posted via http://www.ruby-forum.com/.
--
You received th
With the kind of equation you are providing i.e. you have huge records
to access, it will be better if you perform the 'pure sql query' to
test. it might be a rare practice for others to test and testify.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are s
On Nov 7, 1:52 pm, Kellsborojack wrote:
> So what I'm trying to do is once the link is clicked, the relevant
> form is displayed in the .box div rather than on a new page.
I think the simplest way would be to just output all the HTML on the
page, then just hide or show the proper divs using JavaS
> def create_memo
> #does stuff and if there is an error not in validations
> ...
> raise ActiveRecord::Rollback, 'Memo was NOT created. Payment exceeds
> balance due'
> ...
> end
> Steve
I am guessing that you are planning on using later on the message that
you are raising. Why not just a
Hi,
We have developed an application which is running fine.
Our next step is to open our application services as the RESTFUL API for
other applications.
Can anyone tell me how could I proceed to this?
Thanks,
Mike
--
Posted via http://www.ruby-forum.com/.
--
You received this message because
If you're using ruby1.9.2 try:
group :development, :test do
gem 'ruby-debug19', :require => "ruby-debug"
end
in your Gemfile.
I'd imply you should update to Rails 3.0.1 because of a security-update
for nested attributes (if you use 'em).
On 08/11/10 01:52, Icenine Jon wrote:
I'm trying
That may indeed be the new Rails 3 syntax, I haven't spent any time
with that yet, so sorry if I led you astray. But I suspect your
problems began when you used the plural name for your scaffold
argument. Try again, using rails g scaffold_controller Lesson and see
if there is a different ou
Yes.
WIth Rails3 on the way, the usual nifty-generators now work with a " : "
instead of " _ ".
So, nifty_layout becomes nifty:layout, so does with nifty:authentication and
nifty:scaffold.
On Sun, Nov 7, 2010 at 7:18 AM, Ainar Abramovich
wrote:
> Gemfile:
> gem 'nifty-generators'
>
> Terminal
>
I managed to make it work well enough.
I put the following into the blog controller:
def show
@blog = Blog.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @blog
On Nov 6, 7:36 am, venkata reddy wrote:
> Hi all,
> i want to learn ruby on rails.i am using window7 .
> I installed ruby 1.9.2 p0 in "C:\ruby" using one click
> installer.and then installed
> rails using the command "gem install rails". and rails get installed
> successfully. After that i t
Hello, i got the missing sqlite3.dll error, i fixed it with
downloading and placing both the .dll and the .exe in system32 and
Ruby192\bin but now i get the error "The procedure entry point
sqlite3_backup_finish could not be loacated in the dynamic link
library Sqlite3.dll"
I want to run it on
Hello all,
I have a spiffy new rails3 app for which I can run tests individually,
but not via rake. Behold!
> $ ruby -Itest test/unit/test_user.rb
> Loaded suite test/unit/test_user
> Started
> .
> Finished in 0.466033 seconds.
>
> 1 tests, 1 assertions, 0 failures, 0 errors, 0 skips
>
> Test run
I am using Rails 3.0.1 with Devise for user authentication. I am
trying Rails out so if the answer is blindingly obvious please bear
with me.
I have an index page, which has links to the sign up/sign in forms.
All the logic works fine but what I can't work out is how to display
the forms in the in
On Nov 8, 3:57 am, Samnang wrote:
> Hi all,
>
> Currently, I'm developing a rails app that are heavy generating xml
> from restful webservice. My xml representation of web service use
> nokogiri gem to generates xml format that match expected format from
> client. But the problem is data is quit
In Rails 3 you need to include the gem in Gemfile
gem 'ruby-debug'
Cheers!
Arzumy
On Nov 8, 8:52 am, Icenine Jon wrote:
> I'm trying to use ruby-debug but when I try to start the server with it,
> I get an error saying I need to install it (even though it's installed):
>
> tiberius:project Jona
if you are okey with mysql as database go and start with instant rails
On Sat, Nov 6, 2010 at 6:26 PM, Dani Dani wrote:
> venkata reddy wrote in post #959648:
> > Hi all,
> after entering this command i got an error like " the program cont
> > start because sqlite3.dll is missing from your co
51 matches
Mail list logo