On May 25, 6:34 am, Ravi Dtv wrote:
> Frederick Cheung wrote:
> > On May 24, 11:36 am, Ravi Dtv wrote:
>
> >> But, I need to display all the values in @myusers.
> >> How can I pass the values?
>
> > if you pass the :collection option render will render the partial once
> > for each item in the
On May 25, 7:03 am, tonymocha wrote:
> Hi Joao,
>
> Is the same thing. Project ID and Tags leaves as nil for no reason.
>
Are there any warnings in the console ? This really does sound an
awful lot like attr_protected or attr_accessible are being used
without you knowing it.
Fred
> On May 25,
Hi, I'm new to rails and have hit a minor snag that google isn't helping with.
Basically, I can't get text fields or text areas to not include size and cols
attributes in the tags generated when using a form_for f.text_field ...
etc within my view. This results in my applied styles being ov
Not work has_many :through association in rails 2.3.5
Models:
class Role < ActiveRecord::Base
attr_accessible :name
has_many :assignments
has_many :users, :through => :assignments
end
class User < ActiveRecord::Base
attr_accessible :name
has_many :assignments
has_many :roles, :thro
Hi Joao,
Is the same thing. Project ID and Tags leaves as nil for no reason.
On May 25, 4:22 am, Joao Silva
wrote:
> Hi Frederick,
>
> How about :
>
> article = Article.new(:title =>"halo world",:content=>"lorem ipsum",
> :tags=>"test,article,fun",:project_id=>"1")
>
> This example can be found
Frederick Cheung wrote:
> On May 24, 11:36�am, Ravi Dtv wrote:
>
>> But, I need to display all the values in @myusers.
>> How can I pass the values?
>>
>
> if you pass the :collection option render will render the partial once
> for each item in the collection
>
> Fred
Thanks Fred for your rep
Hi All,
Not sure if this is a bug or expected behavior.
I've pasted my log below, but basically the first time that I run
rake rails:freeze:gems, I get action* all unpacked into app/vendor/
rails.the 2nd time I run it? I only get vendor/railties/*
Something I've done wrong?
Thanks,
Da
On Mon, May 24, 2010 at 5:38 PM, Dee wrote:
> Just wondering if there is any reason that the new XSS safety code in
> 2.3.7 is escaping my partials. That don't seem right!
Definitely not right! Are you using the latest rails_xss plugin from
http://github.com/rails/rails_xss ?
jeremy
--
You rec
sso wrote:
> Hi,
> I've adopted a project that uses some rails features I'm not quite
> used to yet. (ie merb, haml)
>
Those aren't Rails features as such. Haml is a separate library -- a
template language that's a superior alternative to ERb (and that you
should learn...). Merb, though, is
How about just passing in the session data hash when you call the
particular workling ob method, something like:
### in ./app/workers/foo_worker.rb
class FooWorker < Workling::Base
def bar(options)
session_data = options[:session_data])
# do something with session.data hash ...
Well, got all the kinks solved and now my application is working just
fine. Thanks a lot Fred, without your comments on this and my other
thread I don't think I would have made it.
On May 24, 2:50 pm, Frederick Cheung
wrote:
> On May 24, 7:10 pm, pepe wrote:> I need to install the
> latest acti
Hi Henry,
Doesn't include any err testing/checking, but ... you could do
something like:
### in some rails project root:
$ cat ./tmp/t.runnable
def parse_lat_lng(json_str)
lat, lng = [0.0, 0.0]
location = JSON.parse(json_str)['results'][0]['geometry']
['location']
lat, lng = location['lat']
how do i access the passing variable in controller. i have done the
passing variable part and when i use params[:variable_name] it gives
error
so could u please explain that a bit?
nirosh
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
Thanks!
Let me clarify.
On my home page, I would like to show the following
top 10 clubs in your area
most popular comments in your area
popular events in your area..
.
.
and so on.
This view will essentially show 10-15 records from 7-8 models. Which
is a lot of queries and of course, its the
The recently released Google maps API v3 returns geocoding info in json
format as shown below. I am sure there is an elegant way to extract the
lat/lng but I have failed to find it after many attempts - can anyone
help? Thanks in advance.
{
"status": "OK",
"results": [ {
"types": [ "poin
Hi,
I've adopted a project that uses some rails features I'm not quite
used to yet. (ie merb, haml)
There is a snippet below. I'm not even sure what other part of the
code to include to help with this. I'm open to suggestions :)
$ merb
...
...
...
~ Compiling routes...
app/views/stretches/sho
Check out the :counter_cache option of belongs_to. If you order by
that and limit to 10, you'll probably have what you're after.
/Ritchie
On May 25, 12:42 am, badnaam wrote:
> What's the best way to handle views that show the top 10/most popular/
> Recently updated/most commented type listing?
>
In the test environment, logging out and back in is not working for me. The
log for the first login looks like this:
Processing UserSessionsController#create (for 127.0.0.1 at 2010-05-24 19:53:57)
[POST]
Parameters: {"user_session"=>{"remember_me"=>"true",
"password"=>"[FILTERED]", "login"=>"
On May 21, 11:29 am, Marnen Laibow-Koser wrote:
> > Also cloud hosting is more expensive
> > than 'classic' hosting unless you plan on being the next Facebook...
>
> Nope. Look at Rackspace Cloud's pricing and say that again with a
> straight face.
Actually Rackspace cloud can be expensive on
Sorry, I had a little typo in my code. That should read:
<%= raw render :partial => 'mypartial' %>
(Note the order in which raw is called.)
On May 24, 8:38 pm, Dee wrote:
> Hey all,
>
> Just wondering if there is any reason that the new XSS safety code in
> 2.3.7 is escaping my partials. That do
Hey all,
Just wondering if there is any reason that the new XSS safety code in
2.3.7 is escaping my partials. That don't seem right!
I've overcome it temporarily by throwing in a "raw" like this:
<%= render raw :partial => 'mypartial' %>
It's also escaping any inline
guys,
It's interesting. Did the post below solve the problem?
On May 19, 11:18 am, jason white wrote:
> this may
> helphttp://www.codecapers.com/post/A-Ruby-on-Rails-Tutorial-for-NET-Devel...
>
> Jason
>
--
You received this message because you are subscribed to the Google Groups "Ruby
on Ra
On May 24, 2010, at 4:11 PM, Marnen Laibow-Koser wrote:
> M Daubs wrote:
>> Jian,
>>
>> This was a common practice a while ago but I would recommend against
>> changing to_params.
>
> Why? I can't think of a good reason.
>
>> It will work but my experience has been that code
>> gets messy a
No because validations happen before the object is saved. Validation
will pass and the object will get saved properly. Well... sometimes.
Sometimes not.
Marnen Laibow-Koser wrote:
>
> Well, there's your problem, then -- you've already made your 10th
> comment!
>
> BTW, you should consider com
M Daubs wrote:
> Jian,
>
> This was a common practice a while ago but I would recommend against
> changing to_params.
Why? I can't think of a good reason.
> It will work but my experience has been that code
> gets messy as you find fringe cases.
Huh?
> I HIGHLY HIGHLY HIGHLY recommend
> yo
Milan Dobrota wrote:
> In the specs it is actually 10.times instead of 9.
>
> Milan Dobrota wrote:
>> post = Post.make
>> 9.times { Comment.make(:post => post) }
>> comment = Comment.new(:post => post)
>> comment.save.should be_false
Well, there's your problem, then -- you've already made your 10
Hi guys,
I have been trying to access session data (I am using the
ActiveRecordStore option) from a background process (Workling in my
case - but I suspect it should be the same for others). It seems to me
it should be fairly obvious since I can pass the session_id to the
background and the sessio
In the specs it is actually 10.times instead of 9.
Milan Dobrota wrote:
> post = Post.make
> 9.times { Comment.make(:post => post) }
> comment = Comment.new(:post => post)
> comment.save.should be_false
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subsc
I have code similar to this:
class Post
has_many :comments
end
class Comment
belongs_to :post
validate :must_not_exceed_ten
def must_not_exceed_ten
errors.add_to_base('Too many comments') unless post.comments.length
< 10
end
end
and in the specs (Rspec + machinist):
post = Post.m
axelsef wrote:
> use text_area
> for example
> <%=
> text_area(:product,:description ,:size=>"100x10",:disabled=>"disabled")
> %>
>
> I hope that will help.
>
> On May 24, 3:13�pm, Ainar Abramovich
That's a really bad solution. Disabled objects are usually a
sign that you're doing something
Hi Frederick,
How about :
article = Article.new(:title =>"halo world",:content=>"lorem ipsum",
:tags=>"test,article,fun",:project_id=>"1")
This example can be found at
http://api.rubyonrails.org/classes/ActiveRecord/Base.html
Did it worked out?
On May 24, 9:11 pm, xeon wrote:
> Thanks for
Hi Frederick,
How about :
article = Article.new({:title =>"halo world",:content=>"lorem ipsum",
:tags=>"test,article,fun",:project_id=>"1"})
This example can be found at
http://api.rubyonrails.org/classes/ActiveRecord/Base.html
Passing data this way requires an hash therefore :title => "bla b
Fred comes once again to the rescue! :)
Thanks buddy. I owe you (another) one. Unfortunately I am running into
other problems now but I think I'll be OK after this major (for me)
hurdle.
On May 24, 2:50 pm, Frederick Cheung
wrote:
> On May 24, 7:10 pm, pepe wrote:> I need to install the
> late
On May 24, 2010, at 11:38 AM, Ralph Shnelvar wrote:
>
>> Or skip the RJS and just write JavaScript. I tend to think that RJS is
>> one of the more pointless features of Rails...
>>
>> Best,
>> --
>> Marnen Laibow-Koser
>> http://www.marnen.org
>> mar...@marnen.org
>
> Which is exactly what I h
Am adding to a sortable list using Ajax, and to get the Scriptaculous
effects to kick in after the add, the only way I have found is by
re-executing sortable_element.
Can anyone suggest a better way of doing this, as the eval in here is
not good.
<%= link_to_remote "Add",
:url => { :controlle
nirosh wrote:
> i have a JavaScript variable and i need to pass that to controller
> with the remote_function method.
> how do i pass this?
The same way you pass any parameters using HTTP. You can either put them
in the query string or in the form data of a POST request. Make sure you
encode the
I think this article by Brian Cardarella may answer my question. I'll
figure this out and document what I had to do for all the other
"noobs" out there.
http://cardarella.blogspot.com/2010/01/rails-2-rails-3-side-by-side.html
On May 24, 11:41 am, Hassan Schroeder
wrote:
> On Mon, May 24, 2010 a
Thanks for reply Frederick.
Is a new project. I didn't use any plugins. More funny thing is I
manually set the attributes without problem.
Example:
article.project_id=1
It works. However, not for parsing by array. I have did a few project
before, this is the first time encounter this funny issue
On Mon, May 24, 2010 at 11:38 AM, Ralph Shnelvar wrote:
> But I _still_ can't find a decent tutorial that explains how to send an
> XHR request to a RoR app and what to do on the server side to process
> the request.
? "AJAX tutorial" turns up quite a list on Google... There's no reason
an expla
On 24 mai, 15:56, Peter De Berdt wrote:
> On 24 May 2010, at 15:16, Julien Cornuwel wrote:
>
> > I've been gooogling around for quite some time now and I didn't find a
> > solution. If I missed it, feel free to RTFM me (with a link,
> > please) ;-)
>
> http://apidock.com/rails/ActiveResource/Base
Wow, I feel extremely stupid that the solution was right in front of
my eyes.
Thanks Fred
On May 24, 2:51 pm, Frederick Cheung
wrote:
> On May 24, 6:56 pm, anon_comp wrote:
>
> > Just need some help on how to run an .exe file in Ruby.
>
> > I tried the code:
>
> > f = IO.popen("C:\analog 6.0\an
I understand the idea of having apache serving static content but
anyways what do you think about this as i am with similar question in
mind.
#controller
class HomeController < ApplicationController
def index
page = params['page']
if page
begin
# page var is the same as
I understand the idea of having apache serving static content but
anyways what do you think about this as i am with similar question in
mind.
#controller
class HomeController < ApplicationController
def index
page = params['page']
if page
begin
render "page_views/" + page
On May 24, 6:56 pm, anon_comp wrote:
> Just need some help on how to run an .exe file in Ruby.
>
> I tried the code:
>
> f = IO.popen("C:\analog 6.0\analog.exe")
> puts f.readlines
That's probably because you haven't escaped those backslashes.
Fred
--
You received this message because you ar
On May 24, 7:10 pm, pepe wrote:
> I need to install the latest actionwebservice from source. I have
> spent quite a bit of time looking for info on the net and reading
> books but couldn't find a clear and cut set of instructions about how
> to do this.
>
> This is the first time I try to build
On May 24, 6:01 pm, tonymocha wrote:
> Hi,
>
> I have come into an odd problem that I couldn't figure out why.
> Basically, what I did is to save a record from the form, but there's
> some field that parsed to the active record returns as nil.
>
> Example:
>
> article = Article.new({"title"=>"ha
Every time I try to update actionwebservice the system tells me there
is nothing to update. I tried installing the gem specifying version
2.3.2 (apparently the latest) and it couldn't find it. In any case
that would not change much because in the gemspec file it still says
that it requires actionpa
For anyone still interested, I found that I can use ENV['JBOSS_HOME'] on
JRuby; haven't checked if it works on C Ruby, but I would guess it does.
On Mon, May 24, 2010 at 2:13 PM, Joshua Martin wrote:
> Does anyone know how I can get a system variable like JAVA_HOME or
> JBOSS_HOME from within Ra
On Mon, May 24, 2010 at 11:32 AM, Robert wrote:
> Thanks. I do understand that. However, my question is that if I
> execute the command "sudo gem install rails --pre", won't I be
> overwriting my existing Rails 2.3.5 executable which resides in /usr/
> bin? That's what I'm really worried about.
I'm sorry. I wouldn't be able to know as I've never installed Rails 3
Hopefully someone here has and will be able to help you.
On May 24, 2:32 pm, Robert wrote:
> Thanks. I do understand that. However, my question is that if I
> execute the command "sudo gem install rails --pre", won't I be
> o
> Or skip the RJS and just write JavaScript. I tend to think that RJS is
> one of the more pointless features of Rails...
>
> Best,
> --
> Marnen Laibow-Koser
> http://www.marnen.org
> mar...@marnen.org
Which is exactly what I have been trying to do!
But I _still_ can't find a decent tutorial
Maybe you can try updating your gem. I have 1.3.7
You also don't have to worry about changing the version of Rails
becuase you can dictate what version you want Windows to run by using
the code:
rails _2.3.7_ --version
2.3.7 being the version you want to change it to.
On May 24, 2:28 pm, pepe
i have a JavaScript variable and i need to pass that to controller
with the remote_function method.
how do i pass this?
--
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
Thanks. I do understand that. However, my question is that if I
execute the command "sudo gem install rails --pre", won't I be
overwriting my existing Rails 2.3.5 executable which resides in /usr/
bin? That's what I'm really worried about. I'd like to be able to
have both Rails 2.3.5 and the Ra
I'm on Windows. The currently installed version of the gem is 1.2.6
but that is causing conflicts with actionpack. This is the last step
to try and solve a conflict in my application using web services. I am
trying to install from source because I made a change to the required
versions of other gem
Ralph Shnelvar wrote:
>
>> RJS templates are what you're looking for. Cody Fauser's pdf document
>> with
>> the same title at O'Reilly is the best $10 bucks you'll ever spend on
>> this.
>>
>> HTH,
>> Bill
>
> It's a terrific article that is quite out-of-date.
>
> Now I have to struggle to u
sorry didn't read your question completely
You can choose your version using this command:
rails _2.3.5_ --version
You can change between versions if you do this and shouldn't harm
whatever project you have under an old rails verion
On May 24, 2:10 pm, anon_comp wrote:
> You need to get into t
What system are you using and have you installed gem yet? If you don't
know, you can simply see if you installed it by typing in your OS
console
gem -v
this should give you what version of gem you're running on or nothing
at all if you haven't installed gem.
On May 24, 2:10 pm, pepe wrote:
> I
Does anyone know how I can get a system variable like JAVA_HOME or
JBOSS_HOME from within Rails/Ruby?
--
_
Joshua S. Martin
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send ema
You need to get into the system.
Try typing sudo (aka super user/super admin)
$ sudo
it'll prompt you to put in your password if you are the admin of your
computer.
Once you're in and have the permisison, you can install rails. (sudo
will stay in your command prompt until you exit from it)
$ s
I need to install the latest actionwebservice from source. I have
spent quite a bit of time looking for info on the net and reading
books but couldn't find a clear and cut set of instructions about how
to do this.
This is the first time I try to build a gem from source and I am
unsure as how to pr
Just need some help on how to run an .exe file in Ruby.
I tried the code:
f = IO.popen("C:\analog 6.0\analog.exe")
puts f.readlines
Which I had a bit of suspicion that it didn't work, and it didn't.
Help please, thanks.
--
You received this message because you are subscribed to the Google Gro
> RJS templates are what you're looking for. Cody Fauser's pdf document
> with
> the same title at O'Reilly is the best $10 bucks you'll ever spend on
> this.
>
> HTH,
> Bill
It's a terrific article that is quite out-of-date.
Now I have to struggle to update the deprecated stuff.
--
Posted
Thanks all!
On May 8, 4:03 pm, Marnen Laibow-Koser wrote:
> slindsey3000 wrote:
> > I have had the worst time getting my forms to accept input for more
> > than one model. I tried using accepts_nested, and other techniques
> > and finally got it all working. But it was not fun. I never did get
Hi,
I have come into an odd problem that I couldn't figure out why.
Basically, what I did is to save a record from the form, but there's
some field that parsed to the active record returns as nil.
Example:
article = Article.new({"title"=>"halo world","content"=>"lorem ipsum",
"tags"=>"test,artic
What's the best way to handle views that show the top 10/most popular/
Recently updated/most commented type listing?
Should I have a separate model that is populated with records from
other models by a background job or should I need to use some sort of
caching? Perhaps both?
Thanks!
--
You rec
Active Directory (http://en.wikipedia.org/wiki/Active_directory) is
Microsoft's implementation of LDAP (http://en.wikipedia.org/wiki/
LDAP). I use the ruby-net-ldap gem (http://net-ldap.rubyforge.org/)
to access it. Comments in the code provide an overview of LDAP,
document the methods and provide
use text_area
for example
<%=
text_area(:product,:description ,:size=>"100x10",:disabled=>"disabled")
%>
I hope that will help.
On May 24, 3:13 pm, Ainar Abramovich
wrote:
> Hi to everyone! I need to split one long line in two or multiple
> lines.. how can I do that? I have a form where you can
Ainar Abramovich wrote:
> Hi to everyone! I need to split one long line in two or multiple
> lines.. how can I do that? I have a form where you can write in for
> example 200 character long line ("a..."), when I submit
> it(line contains no spaces), char line updates in my blog, but the
> o
On May 24, 2:26 pm, Jian Lin wrote:
> But looks like they happen at the same time, instead of one after
> another. Is there a way to make it happen one after another?
The visual_effect takes a queue option, read something like
http://script.aculo.us/docs/EffectQueues.html to understand how ef
Frederick Cheung wrote:
> On May 24, 10:16�am, Max Williams wrote:
>> � #my code
>> end
>>
>> I feel like this should be easy but can't figure it out. �Can anyone
>> show me how? �I've tried just using page.call with some jquery but again
>> can't work out how to get the resultant value back into
Tom Mac wrote:
> Hi
> I did not get a reply to this. Any comment please?
>
> Tom
Well, you've obviously done some of your research in order to quote the
abilities of attachment_fu.
What about paperclip? The source of a proper comparison should be
yourself, as you are the one making the judg
Solved it.
VIEW
<%= select ("proCodes", "id", @productCode.map {|u| [u.value,u.id]})
%>
On 24 May, 10:05, slippy wrote:
> hey, its my first day developing with ruby and i am having some
> trouble getting data from a find and then putting it in a select drop
> down.
>
> here is my code,
>
On 24 May 2010, at 15:16, Julien Cornuwel wrote:
I've been gooogling around for quite some time now and I didn't find a
solution. If I missed it, feel free to RTFM me (with a link,
please) ;-)
I want to make two rails apps (on different servers) able to
communicate securely through SSL.
Meanin
On May 24, 11:36 am, Ravi Dtv wrote:
> But, I need to display all the values in @myusers.
> How can I pass the values?
>
if you pass the :collection option render will render the partial once
for each item in the collection
Fred
--
You received this message because you are subscribed to the
On May 24, 10:16 am, Max Williams wrote:
> Hi all
>
> I have a file "index.js.rjs" where i only want to run the code in it
> (which updates the contents of a div in typical ajax style) if a
> variable i have from params is the same as a value of one of the form
> fields on the page (which has th
I'm trying to install Rails 3 on a brand new MacBook Pro running OS X
10.6.3, Ruby 1.8.7, and Rails 2.3.5 and I'm wondering if I've hosed
myself. So far, I've run these commands:
$ gem update --system
$ gem install arel tzinfo builder memcache-client rack rack-test rack-
mount erubis mail text-fo
Hi,
I've been gooogling around for quite some time now and I didn't find a
solution. If I missed it, feel free to RTFM me (with a link,
please) ;-)
I want to make two rails apps (on different servers) able to
communicate securely through SSL.
Meaning, when app1 needs data from app2, it connects t
I have the same trouble, but using the ruby 1.9.1
it's a kind of bug?
--
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
Hi to everyone! I need to split one long line in two or multiple
lines.. how can I do that? I have a form where you can write in for
example 200 character long line ("a..."), when I submit
it(line contains no spaces), char line updates in my blog, but the
only bug is there that line is post
Hi All,
What is Active Directory authentication?. How to use in Ruby on
rails?.
Regards,
Periyasamy.R
--
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 unsubscri
hey, its my first day developing with ruby and i am having some
trouble getting data from a find and then putting it in a select drop
down.
here is my code,
IN MY CONTROLLER
@foundCode = Code.find(:all)
IN MY VIEW
<%= f.select_tag 'code', options_for_select(@foundCode) %>
THE OBJECT
- !ruby/o
I was going to change the background of a div from white to red and then
from red back to white, so this is used in an RJS file:
page[:vote_score].visual_effect :highlight, :startcolor => '#ff',
:endcolor => '#ff'
page[:vote_score].visual_effect :highlight, :startcolor => '#ff',
:
Bill Walton wrote:
> Hi Jian Lin,
>
> On Mon, May 24, 2010 at 7:33 AM, Jian Lin wrote:
>
>
>> Will there be situation where the code is quite big (like 1 or 2k) that
>> RJS can use some sort of static Javascript already loaded to handle the
>> effect?
>>
>
> You can call any loaded Javascript
Hi nirosh,
belongs_to associations represent other models/tables not controllers.
You can have as many different Controllers as you like, created
through migrations or manually - they are simply the way of 'getting
in' to your application. All the heavy lifting should be done in the
models.
You
I don't think controllers have anything to do with your question. A
controller is a program that receives requests from the browser and
processes them, most likely involving models, and then sends a
response back to the browser.
What you are talking about, I think, is about activerecord
associatio
If I were you I would buy a book or find info on the web and study how
activerecord associations work. That will most likely clear all your
questions and help you solve the problem. The examples I've read in
any of the books I have are very clear. Good books: Agile Web
Development with Rails and Th
Hi Jian Lin,
On Mon, May 24, 2010 at 7:33 AM, Jian Lin wrote:
> Will there be situation where the code is quite big (like 1 or 2k) that
> RJS can use some sort of static Javascript already loaded to handle the
> effect?
>
You can call any loaded Javascript function, including ones you've coded
So it looks like on RoR, when Ajax (using form_remote_tag) returns a
success code, Javascript is also returned to handle the visual effects.
using Fiddler, I do see the following response:
try {
Element.update("vote_score", "Score 58");
$("vote_score").visualEffect("highlight");
}
Ravi Dtv wrote:
> Hii
> How can i pass array of values from the controller to partial.
>
>
Just like you'd pass any other variable to any other view. No
difference.
> def dispfriends
> @myfriend=[]
> @myfriendlogin = []
> @myusers=[]
This is terrible controller code. To start with, the nam
Private and protected methods can both be called from the same class
or a subclass (eg your controller classes typically inherit from
ApplicationController, your model classes typically inherit from
ActiveRecord::Base, etc). This is different from the conventions used
in many other languages like
Jian,
This was a common practice a while ago but I would recommend against
changing to_params. It will work but my experience has been that code
gets messy as you find fringe cases. I HIGHLY HIGHLY HIGHLY recommend
you look at norman's friendly_id gem. It is extremely easy to setup
and all you
You opened my eyes! I haven't figured out what private was. I thought
that you could access the method logins/set_as_admin even if it was
private because I thought by /logins/ you have access to the class,
that's what I understood before when I read that private methods could
accessed by the class
Hi,
I am looking for a solution to generate 'Automated sitemap.xml' in ROR.
Is there any gem available for the same or if there is any other
solution..?? I was earlier using site map generator but that doesn't
fulfill my purpose anymore.
--
Posted via http://www.ruby-forum.com/.
--
You received
>
> What would happened if you never use private methods? Will it be some
> security issue (and if yes, I'd like to see an example if it is
> possible)
OK, here's a quick example. Assuming you have the default routing rules in
place so it handles /:controller/:action
class LoginsController < Ap
def dispfriends
@myfriend=[]
@myfriendlogin = []
i=0
@currentgroup = Group.find_by_id(params[:groupid])
puts @currentgroup.id
@currentfriends=
GroupFriend.find_all_by_user_id_and_group_id(current_user.id,
@currentgroup.id)
for n in @currentfriends
@myfriend=n.friend_id
@myusers = User.fi
Hello
I was reviewing some rails code lately and I see that in some cases
they use private methods (especially in application controller
methods). I understand that it is considered a good practice since the
methods aren't used anywhere else outside of application controller,
but my question is:
Hii
How can i pass array of values from the controller to partial.
def dispfriends
@myfriend=[]
@myfriendlogin = []
@myusers=[]
i=0
@currentgroup = Group.find_by_id(params[:groupid])
puts @currentgroup.id
@currentfriends=
GroupFriend.find_all_by_user_id_and_group_id(current_user.id,
@curre
On 24 Maj, 09:41, pavling wrote:
> On 24 May 2010 07:42, Smoq wrote:
>
> > Could you let me know what shuld be included in controller to list on
> > the page ALL user's answers?
>
> You could populate a variable with the results of a find of the user's
> answers, or just have a variable for the
Hi all
I have a file "index.js.rjs" where i only want to run the code in it
(which updates the contents of a div in typical ajax style) if a
variable i have from params is the same as a value of one of the form
fields on the page (which has the id 'search_timestamp'). I can't work
out, though, ho
1 - 100 of 104 matches
Mail list logo