Cool. I think I get this (poked a page or two to understand what
":collection" was. I'll play around. thank you very kindly!
Jaime Bellmyer wrote:
> This is easy. Say you have a controller users_controller.rb, then in
> config/routes.rb change:
>
> map.resources :users
>
--
Posted via http:/
Learn by Doing wrote:
> Hi,
>
> In my RESTful implementation, :new shows a form for @link . When a
> user clicks on Create, the value of @link is posted to :create through
> params. How do I test the value of params and that :create actually
> uses these value to create a new link.
>
> Right
What's your test suite of choice? Using plain old TestUnit, try
something like this:
def test_link_creates_correctly
post :create, :link => {:name => 'Contact Us', :href => '/
contact', :title => 'Contact Us'}
assert Link.find(:first, :conditions => {:name => 'Contact
Us', :href => '/contact'
This is easy. Say you have a controller users_controller.rb, then in
config/routes.rb change:
map.resources :users
to:
map.resources :users, :collection => {:new_special => :get}
If you have any other questions, hit me up via twitter (@kconrails) or
my blog:
http://kconrails.com/contact_me/
Hello and thank you in advance.
I am fairly new to Ruby and Rails and am working on an app in order to
get more familiar. I feel I should be able to solve this problem on my
own but have thus far been stymied. Thanks for your help.
I used scaffold to generate the basic index/new/show/edit/destroy
Robert Walker wrote:
[...]
>> Now that's just not true at all. If nothing else, lots of mobile
>> browsers have deficient or nonexistent JS implementation -- even on
>> smartphones like the BlackBerry Curve. (I speak from experience.)
>
> Such dumb devices would likely need their own dumbed do
Marnen Laibow-Koser wrote:
> Robert Walker wrote:
>> Marnen Laibow-Koser wrote:
>>> Whereas I'd use it in preference to the JS, because it's more reliably
>>> guaranteed to work.
>>
>> I've given up the battle to make everything work without JavaScript.
>
> I have not and will not, except in iso
Hi,
In my RESTful implementation, :new shows a form for @link . When a
user clicks on Create, the value of @link is posted to :create through
params. How do I test the value of params and that :create actually
uses these value to create a new link.
Right now I test :create by by using a link
Robert Walker wrote:
> Marnen Laibow-Koser wrote:
>> Whereas I'd use it in preference to the JS, because it's more reliably
>> guaranteed to work.
>
> I've given up the battle to make everything work without JavaScript.
I have not and will not, except in isolated circumstances.
> JavaScript is
I started learning a little over a year ago. Although I have a long
way to go, I can look back and see that creating an example app that
was in the book (Agile Web Development with Rails, Third Edition),
really helped me to learn what RoR can do. From there, I read through
the details of the langua
There's actually an HTML meta tag that will handle redirects.
http://www.web-source.net/html_redirect.htm
Just change the content="x" to 5 so it'll indicate to the browser to wait 5
secs before redirecting to the given address.
Regards,
James
On Sun, Jan 17, 2010 at 11:22 AM, tashfeen.ekram
wro
Marnen Laibow-Koser wrote:
> Whereas I'd use it in preference to the JS, because it's more reliably
> guaranteed to work.
I've given up the battle to make everything work without JavaScript.
JavaScript is most certainly winning this fight. Hardly anyone disables
it anymore so I think it safe en
Help! Can anyone see why my code isn't inserting the course_id
parameter into my table?
<%= f.label :course_id %>
<% for course in current_user.courses.find(:all, :order =>
'order_taught') %>
<%= check_box_tag 'assessment[course_id][]', course.id %>
<%=h course.name %>
On Jan 15, 8:14 pm, CoolAJ86 wrote:
> However, if you can point me to a full-blown, simple, "Hello World!",
> "Patching Rails for Dummies" style guide which details how to write
> the tests and the whole shebang, then I would be willing to do that.
Have a look at http://guides.rubyonrails.org/
Strangely, this code...
<% f.semantic_fields_for :options do |c| %>
<% @document.options.each do |option| %>
<%= c.input :value, :label => option.name, :hint => option.hint
%>
<% end %>
<% end %>
... end's up posting the names, the form fields and the hints twice.
Also it seems
give the value of such function wat you want, but as string,
such as this in a view:
:onclick => "toggle_memos('#{memos[:name]}')"
or
:onclick => "toggle_memos('something')"
and in your *.js
function toggle_memos(foo) {
// doSomethingUsefullWithFoo
console.log(foo);
};
LeFnod
On 1
Does anybody know how to authorize state transitions? I'm using
state_machine in my rails app to define the state of an Article
(published or unpublished). I'm also using declarative_authorization
to determine the authorizations a user has. But how do I authorize a
state transistion (determine if t
another way is reusing code as in http://github.com/ryanb/nifty-generators
given,
by using the layout helpers down to each action by extending the
default includes
given in your layout(s)
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To
Hello to all Ruby members, I am eager to learn Ruby for Rails..
I just bought the book "Ruby For Rails" by David A. Black
Is it good enough for the beginner like me to start with this book
Please Suggest...
--
You received this message because you are subscribed to the Google Groups "Ruby on Rail
> To get an array of ordered keys for the POSTed keys/vals, you could do
> something like:
>
> ...
> if request.post?
> ordered_keys = request.raw_post.split('&').collect {|k_v|
> CGI::unescape(k_v.split('=').first.to_s) }
> ...
Thanks. That worked great for parsing the raw post data (a
I want to create a page that when it opens it waits about five seconds
and then redirects the user to another page. Is this normally done
with JS? What is the easiest way to do this rails.
Thanks.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk"
When I try to delete a grandfather in a grandfather, father & son
relationship as in the following, the grandfather and all the
associated fathers are deleted, but the sons are left as orphans.
It seems ROR can do a 2-tier cascading delete, but fails on a 3-tier
cascading delete.
create_table "g
2010/1/16 Laim Bee :
>
> I also tried creating a new Note object directly in the partial itself
> and this didn't work. Is this the correct action that will occur when
> you click the Post button:
>
> Looks in Routes > Runs method from Controller > Resolves View
Yes, though I would say renders vie
On Jan 16, 11:21 am, "Michael M." wrote:
> > For each inherited model of Message that you access by
> > Post.inherited_modelname(s) (like in Post.first.letters) you need a
> > has_many declaration in the Post class.
>
> Thanks. I thought has_many creates automatically the relation to the
> subcl
On Jan 15, 4:25 pm, parkurm wrote:
> Hi all,
>
> Stuck at this problem for several days. Tried to use named_scope,
> scope_out, and plugin such as searchlogic, but no result.
>
> The problem is as follows: I have a pic table and tag table, and a
> join table called pic_tag (with only pic_id and
Don't know if i should write this to rails or ruby mailinglist. But in the
case i wan't to extend the facebooker-plugin without touching it, i will
here.
1. Instance-Methods of modules?
The methods in a module may be instance methods or module methods. Instance
methods appear as methods in a class
Bruno Grasselli wrote:
> Try to execute "rake purchaseAlcohol" from here:
>
> D:/NetBeansProjects/RubyCode
>
> 2010/1/16 Aashish Kiran
same error as before
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: T
I also tried creating a new Note object directly in the partial itself
and this didn't work. Is this the correct action that will occur when
you click the Post button:
Looks in Routes > Runs method from Controller > Resolves View
I have tried putting logger.debug in the create method of the Note
On Fri, Jan 15, 2010 at 9:51 AM, gerbdla wrote:
> Does anyone know of a place where I can get either online or classroom
> training in the US preferrably on the west coast?
>
Have you looked at http://railsbridge.org/ or the associated site
http://railstutor.org
They are more focused on getting y
I do use this in a live project - its not just a "hey wouldn't this be cool
moment" =)
Would love to hear feedback/suggestions if anyone has some to share..
On Wed, Jan 13, 2010 at 5:33 PM, Marnen Laibow-Koser
wrote:
> Stephen wrote:
> > Just curious - did anyone try this out with success/fail
Try to execute "rake purchaseAlcohol" from here:
D:/NetBeansProjects/RubyCode
2010/1/16 Aashish Kiran
> Bruno Grasselli wrote:
> > Where are you keeping this file?
> >
> > If you put it in somewhere like:
> >
> > lib/tasks
> >
> > It should work.
> >
> > Try to add:
> >
> > desc "some text"
> >
> For each inherited model of Message that you access by
> Post.inherited_modelname(s) (like in Post.first.letters) you need a
> has_many declaration in the Post class.
Thanks. I thought has_many creates automatically the relation to the
subclasses.
--
Posted via http://www.ruby-forum.com/.
--
Bruno Grasselli wrote:
> Where are you keeping this file?
>
> If you put it in somewhere like:
>
> lib/tasks
>
> It should work.
>
> Try to add:
>
> desc "some text"
>
> Before each task and then you can look for it when you type:
>
> rake -T
>
> 2010/1/16 Aashish Kiran
when i execute
D:\
hello,
I am trying to convert a php script into a rails script. I came accross
snmpset() and snmpget() functions and I am stuck here.
Here is a part of the php script. Please help me in converting these two
functions.
$oid = '1.3.6.1.4.1.318.1.1.12.3.3.1.1.4';
$toret = false;
if($pdb->connec
Where are you keeping this file?
If you put it in somewhere like:
lib/tasks
It should work.
Try to add:
desc "some text"
Before each task and then you can look for it when you type:
rake -T
2010/1/16 Aashish Kiran
> -rakefile-
>
> require 'csv'
> require 'rake'
> task
Hello,
I successfully dumped the database in postgresql. Now I want to connect
my rails application to the postgresql database, able to start the
server, but I am getting this error when I browse the application from
the browser.
script/server
=> Booting WEBrick
=> Rails 2.3.5 application startin
Thanks for suggesting BIND, I usually only install BIND on a server
running a nameserver, but this helps :)
I've decided to go another way though. We can use the SMTP server on
the receiving end directly from Rails, because it accepts direct SMTP
requests from our server. Now I'd like to use two A
gerbdla wrote:
> Does anyone know of a place where I can get either online or classroom
> training in the US preferrably on the west coast?
>
> Thanks
i am a part time trainer for ruby on rails. If you want to know more
please contact me at aashishkir...@yahoo.com
--
Posted via http://www.ruby
-rakefile-
require 'csv'
require 'rake'
task :purchaseAlcohol do
puts "Purchased Vodka"
end
task :mixDrink do
puts "Mixed Fuzzy Navel"
end
task :getSmashed do
puts "Dood, everthing’s blurry, can I halff noth’r drinnnk?"
end
---end
when I run
39 matches
Mail list logo