On Thu, Jan 7, 2010 at 10:10 AM, Pale Horse wrote:
> Example A: "Example One"
>
> What I need is a string method to remove " One" from that string so the
> result is just "Example".
>
> I'm sure this is very simple but I just require a swift response.
How about "Example One".split?
--wpd
--
You
I run into this question each time I add a validation to my model.
Should I add a unit test for that validation?
On the one hand, I've heard/read the philosophy: "Q: What should I
test? A: Only the stuff you care about working".
On the other hand I've heard/read, "You don't need to test methods
On Mon, Dec 21, 2009 at 9:40 AM, Thufir wrote:
> While I'm not currently using the whole rails environment, I may utilize
> the framework in the future. In the meantime, I'm not clear on the
> syntax for establishing a foreign key relationship for an active record
> association using "t.reference
I know the scaffold generator is really only useful for beginners
and/or very the preliminary state of a project, but I find that I use
it a lot (especially, since I am still a beginner). There are a
couple of things I find myself tweaking (or wanting to tweak, but
never getting around to tweaking
find(:all, ...) returns an array.
find(:first, ...), or equivalently, find_manufacturer(some_id) returns
a single item.
try:
@manufacturers = Manufacturer.find(:all, :conditions => {:id => params[:id]})
@manufacturers[0].show_manufacturer_details.
--wpd
--~--~-~--~~~-
guestlists is plural.
event.guestslists returns a list of Guestlist records.
If you want all of the notes for all of the guestlists for a
particular event, (as an array) you might try something like:
event.guestlists.collect(&:notes).flatten
A true Rubyista could probably tell you a much more
On Tue, Oct 20, 2009 at 11:03 AM, theambler wrote:
> Any ideas?
Can you validate the page (say, at http://validator.w3.org/)? When
I've run into weird things like this, I have restarted by development
server on port 80 and pointed the validator at the page on my
development server just to see w
You don't show your Part model, but I suspect that it looks something like:
class Part < ActiveRecord::Base
belongs_to :category
end
This allows you to do something like:
@part = Part.find(params[:id])
@category = @part.category
Note the subtle difference between what I wrote and what you
In the mean time, can you work around this issue with something like:
Create a separate table with a 1:1 relationship to your current table
Migrate the field you want to touch to the new table.
Touch the field in that table, which will leave the updated_at field
in your original table alone.
You
On Thu, Oct 15, 2009 at 1:06 PM, Marnen Laibow-Koser
wrote:
> I wonder. RSpec and Cucumber are good even for small, simple stuff.
> You're falling into the trap of assuming that the Rails core team is
> perfect.
>
:-)
That may be the case. I prefer to think of it as assuming that the
Rails co
On Thu, Oct 15, 2009 at 12:48 PM, Marnen Laibow-Koser
wrote:
> Patrick Doyle wrote:
> True to a point. Have you played around with anything else out there
> (RSpec?)?
Not yet... My applications and their associated tests have been
trivial and mostly been used as a learning tool for m
On Thu, Oct 15, 2009 at 12:27 PM, Matt Jones wrote:
> On Oct 14, 1:19 pm, Patrick Doyle wrote:
>>
>> The problem is, there is an instance variable in my controller that is
>> set during the handling of the first #add_lot_to_assembly action. It
>> remains set for th
2009/10/15 Pål Bergström :
>
> Pål Bergström wrote:
>> How should a create look like in order to get error_messages being
>> displayed, going back to new and show the error message? I can't get it
>> working so I must miss something.
>
> Could it be that I have to "turn off" RESTful somewhere?
No,
2009/10/15 Pål Bergström :
> How should a create look like in order to get error_messages being
> displayed, going back to new and show the error message? I can't get it
> working so I must miss something.
If the create fails, the controller could/should (re)render the "new" view.
The "new" view
... ok, I may be going about this the wrong way, or perhaps, a less
efficient way than is optimal, but I would like to test a little bit
of AJAX on one of my web pages. When I test this by hand, I bring up
the page which shows a select box, I select an item from the drop down
list, see another se
On Fri, Oct 9, 2009 at 9:01 AM, Billee D. wrote:
>> Is there a non-standard way to do this specific to Sqlite3, MySQL, etc... ?
>
> You can use a view:
>
> http://dev.mysql.com/doc/refman/5.0/en/create-view.html
>
>From what I've read, using #default_scope and adding an index to my db
seem to be
On Fri, Oct 9, 2009 at 12:34 AM, Sijo kg
wrote:
>
>> "if �...@sub_categories == nil".
>
> Hi
> Check @sub_categories.blank?
>
I'm pretty sure that #blank? is supposed to be used to check if a
parameter is present or, if present, is blank. I think the method
you're looking for here is #empty?
On Thu, Oct 8, 2009 at 7:59 PM, Hassan Schroeder
wrote:
> On Thu, Oct 8, 2009 at 4:50 PM, Patrick Doyle wrote:
>> Is there a standard (or better) Rails way to indicate the same thing?
>
> See:
> <http://ryandaigle.com/articles/2008/11/18/what-s-new-in-edge-rails-defa
I know this is kinda basic, but who else could I ask besides you folks?
Is there a standard SQL way to indicate that the records in a database
should always be returned sorted by a particular column?
Is there a standard (or better) Rails way to indicate the same thing?
Is there a non-standard w
On Wed, Oct 7, 2009 at 5:29 PM, ct9a wrote:
>
> thank you. Just had a look at it.
>
> Whenever you load data into objects in the controller (which gets
> received by the view), how do you stop the first element from being
> selected by default when you load the page?
>
> In relation to the exampl
On Wed, Oct 7, 2009 at 12:45 PM, Colin Law wrote:
> 2009/10/7 Patrick Doyle :
>> Are there good tips and resources for debugging unit tests?
>
> Have a look at the rails guide on debugging. Particularly the section
> on ruby-debug.
>
Thanks. That's what I was loo
On Wed, Oct 7, 2009 at 11:33 AM, Marnen Laibow-Koser
wrote:
> Patrick Doyle wrote:
>> Are there good tips and resources for debugging unit tests?
>
> Just call the debugger from within your app code, or from the test
> itself. When the "debug" statement
I'm sorry if this sounds like a totally newbie question, but...
Are there good tips and resources for debugging unit tests?
Currently, I just fire up script/console using the "test" environment
and just poke around randomly until I hit upon some inspiration. But
I think there should be a better
I learned how to create dynamic select boxes by reading
http://pullmonkey.com/2008/3/30/dynamic-select-boxes-ruby-on-rails/
--wpd
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post
On Mon, Sep 28, 2009 at 6:07 PM, Marnen Laibow-Koser
wrote:
> Patrick Doyle wrote:
>> I have the following:
>>
>> @lot = Lot.find(params[:id])
>>
>> part_nums = Part.all(:conditions => ["id <> ?", @lot.part.id])
>>
>> I guess
On Mon, Sep 28, 2009 at 6:18 PM, Marnen Laibow-Koser
wrote:
> Frederick Cheung wrote:
> [...]
>>> That's going to iterate over all of the records. �twice! �in interpreted
>>> code!
>>
>> partition will do it in one
>
> Hey, that's good to know!
>
> If you need to do the partitioning in the DB, y
On Mon, Sep 28, 2009 at 5:42 PM, Frederick Cheung
wrote:
>> On Sep 28, 10:32 pm, Patrick Doyle wrote:
>
> partition will do it in one
>
Thanks Fred, that's exactly what I was looking for.
> Try both, benchmark them - don't take some random person on the
> intern
I have the following:
@lot = Lot.find(params[:id])
part_nums = Part.all(:conditions => ["id <> ?", @lot.part.id])
I guess I should mention that
Lot :belongs_to => :part
I was looking at the log following the execution of these two
statements and I saw something like this:
Lot Load (0.4ms) SE
> No need for send here:
>
> def part(*args, &block)
> lot.part(*args, block) # may need an if block_given?
> end
>
I was thinking that I would have to use #send since there is so much
Ruby magic wrapped inside ActiveRecord in order to map column names to
object attributes, but a very simple test
Wow, so now I can do:
class Component < ActiveRecord::Base
# Make component.part a shortcut for component.lot.part
def part(*args)
lot.send :part, args
end
end
...and do things like:
<%= mycomponent.part.number %>
...instead of ...
<%= mycomponent.lot.part.number %>
nice!
--wpd
-
On Fri, Sep 25, 2009 at 1:59 PM, Patrick Doyle wrote:
> On Fri, Sep 25, 2009 at 1:55 PM, Marnen Laibow-Koser
> wrote:
>> Part has_many :components, :through => lots
>>
>> mypart.components
>>
>> Done!
>
> Light dawns on marble head.
>
> Of
On Fri, Sep 25, 2009 at 1:55 PM, Marnen Laibow-Koser
wrote:
> Part has_many :components, :through => lots
>
> mypart.components
>
> Done!
Light dawns on marble head.
Of course! Sorry for the noise.
--wpd
--~--~-~--~~~---~--~~
You received this message because
class Part < ActiveRecord::Base
has_many :lots
has_many :components # or, maybe not
end
class Lot < ActiveRecord::Base
belongs_to :part
has_many :components
end
class Component < ActiveRecord::Base
belongs_to :part # or, maybe not
belongs_to :lot
end
In my domain, a "lot" of "compon
Just in case anybody is interested in this thread... here is what I
got to work for me:
<% form_remote_tag :url => "select_assembly", :update => "disposition" do %>
<%= disposition_select_tag "use_part", @parts, @use_part %>
<% if @use_part %>
<%= disposition_select_tag "use_lot", @lots,
Here is my best idea so far, which, unfortunately, doesn't work...
<% form_remote_tag :url => "select_assembly", :update =>
"disposition", :html => {:id => 'xxx'} do %>
<%= select_tag "use_part",
options_for_select(@parts, @use_part),
:onchange => "$('xxx').submit()"
%>
<% if @
I have a partial that gets rendered in response to a #link_to_remote
call. What I want to do is to display a select box, when the user
selects an item from that box, display a second select box, when the
user selects an item from that box, display a link (or possibly a
submit button) allowing the
If you want to delete all of the data in all of the tables, and you
are using sqlite3, you could just delete db/development.sqlite3 and
then either rerun your migrations, or execute "rake db:schema:load".
If you are using MySQL, then you could probably use PHPMyAdmin or the
command line to delete
Is there a standard approach to the controller actions that exist
solely to populate data do be shown in a view when using RESTful
routing?
I understand and almost appreciate the 7 actions that exist to
implement the ideas of RESTful routes in RoR, but consider a select
box whose contents change
I read your post this morning and thought, "WOW! Rails has defined an
approach for seeding data. That's great! I'll have to look into
that." But I didn't have an answer for you. Then later this morning,
I went looking for something I'd seen on Ryan Bates excellent
Railscasts site (http://rail
Hello Experts!
I am debugging a problem with one of my controllers in my development
environment and I would like to see the actual HTTP request as it
comes in. Is there some option or configuration file for mongrel
(which is what gets started from script/server) that will display or
log the raw
Could this be a pluralization issue?
Did you set up your models as:
class Parent < ActiveRecord::Base
has_many :children
end
class Parent < ActiveRecord::Base
has_many :children
belongs_to :parent
end
class Dog < ActiveRecord::Base
has_many :dogs
belongs_to :child
end
If so, then I w
On Thu, Sep 17, 2009 at 9:14 AM, Marnen Laibow-Koser
wrote:
>
> Patrick Doyle wrote:
>> Suppose one had a hypothetical situation in which records were entered
>> into a database which were later determined to be invalid.
>
> Because they were invalid in the first place,
Suppose one had a hypothetical situation in which records were entered into
a database which were later determined to be invalid.
In this supposedly hypothetical situation, the agile programmer might add
validations to the models to ensure this doesn't, err, wouldn't happen
again.
Following that,
On Wed, Sep 16, 2009 at 2:47 PM, Greg Donald wrote:
> On Wed, Sep 16, 2009 at 12:35 PM, Patrick Doyle wrote:
>
> > Can anybody point me at a recent tutorial that might get me started down
> > this path?
>
> Sounds like you just need to learn Javascript. Doesn'
I would like to add a visual effect to one of my web pages and in the stage
where I don't know what I don't know. I've talked to my buddy Google about
this and (s)he has pointed me at a number of different web pages that all
seem to have 2006 dates on them. I can try looking at them more carefull
On Tue, Sep 15, 2009 at 5:57 PM, Frederick Cheung <
frederick.che...@gmail.com> wrote:
> >
> > Basically, I want to ensure that identifiers are unique for a given part.
>
> Well validates uniqueness of wants scope to be column, so give it one
> (part_id) !
>
> Fred
>
Oh... duh!
(sheepishly creeps
(How?) Is it possible to use validates_uniqueness_of with a scope that is a
belongs_to association?
This is what I would like to do:
class Lot < ActiveRecord::Base
belongs_to :part, :include => true
validates_uniqueness_of :identifier, :scope => :part
end
...but (not surprisingly) when I run
You could try forcing a garbage collection with something like
GC.start (I think). You could try doing that after each connection,
or after every N connections, if it takes too long.
--wpd
--~--~-~--~~~---~--~~
You received this message because you are subscribed
I've found several web pages that describe how to use git submodules
to install plugins, but it seems that those pages are missing
something (or more likely, I am) .
In a nutshell, they advise replacing
$ script/plugin install git://path_to_spiffy_plugin
with
$ git submodule add git://path_to_
Why not convert each date to Ruby Time objects and compare those?
--wpd
--~--~-~--~~~---~--~~
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
>> records.map(&:description).all?(&:==)
nice... I was trying to figure out something with #inject/#sum, but
that looks great.
--wpd
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To p
Hi Folks,
I'm looking for an elegant Ruby one-liner...
I have a set of records in my database that I want to check to see if
the :description field is identical.
And, because it's Thursday morning (where I live), I would like to do
it as elegantly and as one-line-er-ly as I can
Something like..
Is the user who caused the problem friendly or malicious?
If (s)he is (or could be) malicious, then perhaps (s)he didn't use a
browser to create three records in your database, but instead wrote
some code to post three times in quick succession.
I just added a "sleep 5" to my #create method and
I don't know how much this helps, but I've learned the hard way that,
when I write
<%= blah :blah, :blah do |x| %>
<% end %>
I get bizarre (and always incorrect) results.
The reason is that <%= ... %> results in a string that gets inserted
into your HTML stream, while <% ... %> results in some
I wanted to be able to clone fields from one record into a new record,
so I added a select box to allow the user to select the record from
which (s)he wanted to clone (using AJAX to dynamically update the view
when (s)he selects such a record). In my #new action, I check to see
if the :clone_from
Hello
Can anybody recommend a good tutorial for writing functional tests for
pages that are updated dynamically?
Thanks.
--wpd
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to
Hello,
I just ran into a bug in my application in which the behavior differed
depending on whether there was a single element in a particular table
or multiple elements in the table. Right after I fixed the bug, I
thought to myself, "I wonder how I could have structured a functional
test to detec
Is there a more modern way to do something like:
distinct_items = Item.find( :all, :select => 'DISTINCT fieldname' )
I have found a number of circa 2007 web pages that all recommend the
use of :select, and I can't find a :distinct option for #find, but I
figured I'd ask.
--wpd
--~--~-~
On Thu, Jul 30, 2009 at 3:47 PM, cnk wrote:
> database? The flexibility to just have data and not have it
> constrained by a schema is what spreadsheets are good at.
Ohhh... Great answer!
I suspect I'll just gather the data into the table that I know exists
now. I was asking because (as is typic
I am starting to think about writing an RoR app to store some 2-D
data. Most of the data are textual, although there could be a column
of dates or a column of numbers here and there. The issue is:
different data sets have different columns.
Currently, the data are stored in spreadsheets. Many
On Wed, Jul 29, 2009 at 11:48 AM, Robert
Walker wrote:
>
> Patrick Doyle wrote:
>> OK, enough long winded babbling introduction. The tutorials I've read
>> about logging into an application all store the user ID in the
>> session. I presume that the "
On Wed, Jul 29, 2009 at 11:41 AM, Rick wrote:
>
> You could start here: http://www.rorsecurity.info/, download and read
> the book.
Thanks. I'll do that, although I've realized in hindsight that my
question is not specific to RoR. It's much broader. But
rorsecurity.info looks like a great plac
I have read a number of different tutorials that talk about adding a
login page to an application that all contain very similar wording:
"Of course, you would log in over an SSL connection". And I
understand the theory of HTTP and the theory of packet sniffing well
enough to know that, if I type
Someday, I hope to know Rails well enough that answers to questions
like this just roll off the tip of my tongue (or, in this case, the
tips of my fingers as I type on the keyboard). For now, the best
answer I can give you is to reference the web page where I learned how
to use nested routes:
htt
On Thu, Jul 16, 2009 at 8:30 AM, Michael Schuerig wrote:
>
> On Thursday 16 July 2009, Patrick Doyle wrote:
>> Are you saying that its possible to globally change the style rules
>> programatically somehow?
>
> Yes:
>
>
>
> ...
>
>
>
> Unless your stylesheets are prohibitively large, I suggest you don't
> actually switch stylesheets. Instead, set the class of the BODY element
> and and add the appropriate classes to your style rules.
>
> Michael
Hmmm I'm inheriting the stylesheets from another project, so I
don't know if t
So, what's the difference between session[:large_fonts] and
cookies[:large_fonts]?
I had just about decided to keep the state in the session when I saw
the cookies[:large_fonts] example.
The one issue with keeping the state in the session is that it makes
it much more difficult to bookmark the :
Thanks... I wasn't aware of self.get_layout. But my issue isn't so
much selecting a layout as it is passing the parameters around to help
me decide which layout (or which stylesheet) I should use.
I can manually append the options to every link_to and form_for,
etc... link I have in my applicati
There, was that subject sufficiently obtuse to grab your attention? :-)
I would like to have several different stylesheets for my application
that may be selected dynamically as the user navigates through my
site. I have seen this done in PHP by passing parameters to each page
visited selecting
Be careful here, depending on your user base of course.
What will you do if {params[:id]} (I know, incorrect syntax), evaluates to
"delete!" or something else.
If you have a completely trustworthy user base (such as only you, or only
your colleagues, whom you should trust implicitly, otherwise, w
On Wed, Feb 4, 2009 at 9:31 PM, Shankar Ganesh <
rails-mailing-l...@andreas-s.net> wrote:
>
> Hi ,
>
>I'm newbie to Rails can someone help in this.I had struck here in my
> application and actually i solved it using PHP but don't know how to do
> in Rails.
> I have table like this
> --
On Sun, Feb 1, 2009 at 6:25 AM, Tomas Markauskas wrote:
>
> Hello,
>
> I can't figure out how to do this:
>
> I have a Post Model and it :has_and_belongs_to_many :tags. When I edit
> a Post, I want to create checkboxes or a select field (with multiple
> select choices), so I can add tags to a Pos
I think it is possible that you might be missing the OP's point. (Or,
equally possible, I read a completely different question in the original
post.) I think that Nebs would like to create a website with both static
and dynamic pages that has a consistent look and feel. It sounds like (s)he
woul
On Tue, Jan 27, 2009 at 2:26 PM, Dan Smith wrote:
>
> Hi,
> I have a migration which creates several records along with the table.
> eg
> Forum.create :title => "General Discussion", :description => "General
> Chit-Chat"
>
> But I'd like to create a record which accepts an uploaded file, such as
On Mon, Jan 26, 2009 at 3:53 AM, Ruhul Amin <
rails-mailing-l...@andreas-s.net> wrote:
>
> Patrick Doyle wrote:
> > In my controller, I have:
> >
> > respond_to do |format|
> > format.html # index.html.erb
> > format.xml { render :
>
> What you're doing sounds right, most likely though you have a
> validation that is keeping the model from saving.
>
> or, possibly a before_filter.
--wpd
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Ruby
on R
On Thu, Jan 22, 2009 at 9:13 AM, Tony Tony wrote:
>
> Hi all,
>
> I'm having a hard time trying to find a good tutorial on how to generate
> a field (with ajax) from a dropdown selection.
>
> For example:
>
> I have an app where you can select up to two tickets per person. Only if
> the user sele
On Wed, Jan 21, 2009 at 10:12 AM, Mohammad Abed <
rails-mailing-l...@andreas-s.net> wrote:
>
> I wrote the code below which doesn't seem to work, but If I delete the
> last if statement, it does work, obviously for the first two use cases
> only. Is there a better way to write this code? In my rou
On Tue, Jan 20, 2009 at 8:51 PM, Darren Jeacocke <
rails-mailing-l...@andreas-s.net> wrote:
>
> My model is being created but isn't saving. It's like it skips straight
> past saving. Any ideas why it might do this? Updating works fine.
>
> def create
>@volunteer = Volunteer.new(params[:volunt
On Sat, Jan 17, 2009 at 3:05 AM, Ruhul Amin <
rails-mailing-l...@andreas-s.net> wrote:
>
> I want to use pagination with ajax. I have used will_paginate then add
> code to support ajax pagination.
> I have tried with partial with when I use the code
> in index.html.erb
>
> <%= render :partial =>
On Sun, Jan 18, 2009 at 12:45 AM, Ryan Waldron wrote:
>
> I've run into a strange problem with HTTP Basic authentication. I've
> observed this behavior on my dev box (connecting directly to mongrel)
> and on an Apache+Passenger setup on my deployment machine.
>
> I'm doing the standard thing acc
>
> So in a view: <%= eval code.upc %>
>
> *DANGER DANGER DANGER* you are running with scissors here. If an
> attacker can get arbitrary code into your database, using eval like
> this will execute that code in the context of your application.
>
> You may want to read up on Kernel#eval, Object#inst
On Thu, Jan 15, 2009 at 1:29 PM, Tom M wrote:
>
> Patrick,
>
> Thanks... I checked again and the example I posted was a bit off of my
> real example, which uses associations and scopes. According to the
> docs:
>
> All \scopes are available as class methods on the ActiveRecord::Base
> descendent
On Thu, Jan 15, 2009 at 11:21 AM, Tom M wrote:
>
> I may be overlooking something, but it seems to me that it is a
> problem if with this code...
>
> Class Blog < ActiveRecord::Base
> named_scope :unseen, :conditions => "displayed IS NULL"
> end
>
> this test fails...
>
> it "should give a list
On Mon, Jan 12, 2009 at 9:03 PM, Frederick Cheung <
frederick.che...@gmail.com> wrote:
> On 13 Jan 2009, at 01:52, Patrick Doyle wrote:
>
> Post could easily have a can_delete? method that might look something
> like
>
> def can_delete?(current_user)
> user == current
Suppose I have a classic blog application augmented with something like
restful authentication so that users must log in to create blog posts and to
issue comments on other blog posts.
I would like to give a user the option of deleting blog posts, but only
those that (s)he has created.
Do I put t
I would suggest taking a look at Ryan Bates screencast about restful
authentication (http://railscasts.com/episodes/67), write a simple
application or two using restful authentication, and then walk through the
code to see how it all works. IIRC, it has support for doing just what you
asked.
--wp
On Fri, Jan 9, 2009 at 2:24 PM, LRaiz wrote:
>
> BTW. I already installed rubygems-update 1.3.1 and run
> update_rubygems. It did not help.
>
> Does that produce the same effect as
$ gem update --system
?
--wpd
--~--~-~--~~~---~--~~
You received this message b
On Fri, Jan 9, 2009 at 4:04 AM, Zhao Yi wrote:
>
> This is my select_tag code:
>
> <%=select_tag 'project_version_select',
> options_for_select(@project_versions)%>
>
> How can I set the selected value for this select box?
>
Look at the documentation for #options_for_select (see
http://www.railsbr
On Tue, Jan 6, 2009 at 11:07 AM, Ryan Mckenzie <
rails-mailing-l...@andreas-s.net> wrote:
>
> Hello everyone,
>
> I'm using InstantRails 2.0 on a Windows XP 32 bit system.
>
> I'm developing a Rails application where I would like to execute a .bat
> file
>
> I've had a look around and this piece o
Hi Amy,
Without having looked at your cheat sheet yet, nor at any code that might be
out there for validating credit card numbers, can I put in a request to
eliminate one of my (many, I'm sure) pet peeves...
Did/can you address the issue of allowing the end user to put spaces in
credit card number
On Fri, Jan 2, 2009 at 2:53 PM, Vahagn Hayrapetyan <
rails-mailing-l...@andreas-s.net> wrote:
>
> Hi guys and thanks a lot.
>
> post 'account/forgot', :user => {:email => 'j...@example.com'}
>
> is the deal. Patrick, if you could figure this out by putting print
> statements in your controller you
>
> I was able to get formless inputs to pass validation (as XHTML 1.0
> strict or 1.1) at w3.org by putting them inside block elements like
> div or table.
>
> > I've poked around a little looking to see what others have done, and I
> could
> > embed a checkmark image in my page, or I could embed
if you are offended by HTML questions on this list, please feel free to
flame me off list.
I would like to display a boolean value in my #index view as a checkbox that
is checked when true and blank when not true. Is there some markup that can
do this? Is it "legal" to embed an tag outside the
On Thu, Jan 1, 2009 at 5:25 PM, Vahagn Hayrapetyan <
rails-mailing-l...@andreas-s.net> wrote:
>
> Hi,-
>
> I'm wondering how to test POSTing something to an action from a form. I
> am testing an action named "forgot" in my account_controller.rb. It
> takes an email address as a parameter and does
>
> users(:quentin) is instantiating the user based on your users.yml fixture.
> Instead, you'll want to query the database for the user.
>
Yeah, that dawned on me as I wrote my email. But at that point I still
wanted to find a better way to search the documentation. RailsBrain looks
like a great
I am trying to figure out why the following test case doesn't work:
def test_should_allow_admin_to_become_non_admin
put :update, :id => users(:quentin).id, :quentin => {:admin => false}
assert users(:quentin).admin == false
assert_redirected_to users_url
end
For some reason, the "
I have rails-2.2.2 installed on 2 different computers and routinely switch
back and forth between the two of them. I just wrote some code today on my
desktop in which I invoked the #h method inside a controller (because I
wanted to sanitize a string prior to saving it in an instance variable).
Whe
>
> > CartItem#initialze
> > -- expects 0 arguments, you passed 1 argument in via CartItem#new
>
>
> I'm not really sure what do do with that -- what should I change? Are
> you saying only my CartItem#initialze is wrong?
>
Probably.
You could always add a parameter to your CartItem#initialize meth
Your error message is:
wrong number of arguments (1 for 0)
That means that somewhere, you are calling a method that doesn't expect any
arguments and you are passing an argument to it. The stack trace give you a
clue:
ArgumentError in StoreController#add_to_cart
app/models/cart.rb:13:in `initia
1 - 100 of 139 matches
Mail list logo