When a user creates a new record, it should be through a request with the nested form which is then handled by a controller somewhere in your application where you will have access to the client's IP. You would then need to store that IP address as part of your model for later retrieval / display. Right? Or am I not understanding your question?
My application creates new records in a nested form. I want to record
the ip address that created the record (assuming it was created from
the controller in this way). How can I do this, given that
request.remote_ip is not accessible in the model?
Mark
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
@kiran:
for integrating facebook,
i tried facebooker which is outdated, not suitable if you are using rails 3.
i'm using fbgraph right now, you can download a sample app from --> https://github.com/nsanta/fbgraph_example
and see how it works.
you might also wanna look at another gem -> koala (i haven't tried it but it works with rails 3 afaik)
hope that helps :)
--
Regards,
Magesh
blog: http://imagesh.tumblr.com
web: GeexHQ.com
twitter: @iMagesh
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
search on google rfacebook , facebooker , mogile
And also look at github too
That would be more help-full
link are not opening.please give me some more details.
On 1 April 2011 11:34, Narendra sisodiya <naren.sisodiya@gmail.com> wrote:
look at following plug-ins/gemRfacebook http://rfacebook.rubyforge.org/Facebooker http://facebooker.rubyforge.org/--On Fri, Apr 1, 2011 at 11:30 AM, uday kiran <udaykiran.raise@gmail.com> wrote:
--
can u tell me how to integrate facebook in ruby on rails application
please give me help
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
--
~N a r e n
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
--
Thanks:
Rajeev sharma
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
ok
looks like rubyforge.org is down.
you can check facebooker on gihub : https://github.com/mmangino/facebooker
link are not opening.please give me some more details.On 1 April 2011 11:34, Narendra sisodiya <naren.sisodiya@gmail.com> wrote:
look at following plug-ins/gemRfacebook http://rfacebook.rubyforge.org/Facebooker http://facebooker.rubyforge.org/--On Fri, Apr 1, 2011 at 11:30 AM, uday kiran <udaykiran.raise@gmail.com> wrote:
--
can u tell me how to integrate facebook in ruby on rails application
please give me help
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
--
~N a r e n
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
--
~N a r e n
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hello Friends,
I have a requirement where I need to fetch netsuite Inventory Items, for the same I am using "netsuite_client" gem but somehow I can only fetch a single record via "client.find_by('ItemSearchBasic', " method is there any way I can fetch all the inventory items..
Thanks for any help any suggestion.
Abhis
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
link are not opening.please give me some more details.
look at following plug-ins/gemRfacebook http://rfacebook.rubyforge.org/Facebooker http://facebooker.rubyforge.org/--On Fri, Apr 1, 2011 at 11:30 AM, uday kiran <udaykiran.raise@gmail.com> wrote:
--
can u tell me how to integrate facebook in ruby on rails application
please give me help
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
--
~N a r e n
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
look at following plug-ins/gem
can u tell me how to integrate facebook in ruby on rails application
please give me help
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
--
~N a r e n
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
can u tell me how to integrate facebook in ruby on rails application
please give me help
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 1 April 2011 01:22, Bryan Crossland <bacrossland@gmail.com> wrote:
> Someone else might know more as to why "save" returns true in this case. If
> not, then it is most likely a bug.
Try it in your SQL console of choice:
UPDATE my_table SET field1 = 'new value' WHERE id = <non-existant-id-value>
You'll get a message "no records were updated" - that's a successful
execution as far as SQL is concerned.
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 1 April 2011 00:00, Manny 777 <lists@ruby-forum.com> wrote:
> But obviously I'm getting error message about undefined local variable
> sequence.
Are you sure you're not getting "undefined local variable save_seq"?
Did you cut/paste the code here, or did you re-type it (so is it
*exactly* what's in your controller, or could there be small
differences?)
It could be worth you setting save_seq:
high = Users.find(:order => 'sequence_at DESC', :limit => 1)
save_seq = high.sequence
unless high.sequence.nil? || high.sequence == 0
...etc
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I referring to actually sending the page to the printer.
can you please send the process of that/.
Are you referring to actually sending the page to the printer, or generating a "printer friendly page"?
The answer is different depending on which you were referring.
--
Thank you
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi
I am using app_config.yml exactly like
http://railscasts.com/episodes/143-paypal-security
Please help
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.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
How to I handle loading files with relative path?
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Thu, Mar 31, 2011 at 9:06 AM, Alexey Muranov <lists@ruby-forum.com> wrote:
I am posting a related question in the same thread.
It is more of a philosophical question.
Can anybody please give me some philosophical explanation why the
following behavior of ActiveRecord is considered ok (or should i submit
a bug report/feature request?):
In console:
> p = Person.create(:name=>'Bill')
> p.destroy
> p.name # => "Bill"
> p.save # => true
Nothing is saved in the database, but what disturbs me more is that
"save" returned true in such case.
In this first example you are inializing an object instance of Person by calling the "create" method. The "create" method of class Person does a "create" to the database where as the method "new" does not. The "destroy" method you called sends a destroy to the database for the record based on that id but does not destroy the obect instance. This is because object is not a pointer to the database record, it's an instance of the class Person. This is why you can still retrieve the name from your object instance later by calling the method "name". The "save" method should be doing the action of create or update in the database (depending on if the "new" or "create" methods were called to inialize the object instance). It returning "true" is strange since the record in the database is neither being created or updated. That may indeed be a bug.
A more elaborate version:
> p = Person.create(:name=>'Bill')
> p.id # => 1
> pp = Person.find(1)
> pp.destroyed
> p.persisted? => true
> p.destroyed? => false
> p.save # => true
but the database is empty.
Again, what bothers me the most is the "true" returned by "save".
In this example you are inializing two seperate object instances of the class Person. One by calling the method "create" and the second by finding the first record in the database. Again, object instances are not pointers to the database record. The objects "p" and "pp" are totally seperate. Like above, activating the "destroy" method sends a destroy to the database based on the id in the object but does not destroy the calling object or any other object that happens to have the same id value. The "save" method returning true is strange since the record with the id value of 1 can't be created again or updated.
Someone else might know more as to why "save" returns true in this case. If not, then it is most likely a bug.
B.
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
In Rails 2.3.5, is this the proper way to do this?
map.calls "calls/:group/:view/:subselect", :controller => 'calls',
:action => 'index'
map.calls "calls/:group/:view", :controller => 'calls',
:action => 'index'
map.calls "calls/:group", :controller => 'calls',
:action => 'index'
map.calls "calls", :controller => 'calls',
:action => 'index'
I want to accept
/calls
/calls/abc
/calls/abc/def
/calls/abc/def/ghi
where "group" would be assigned "abc" in cases 2-4, "view" would be
assigned "def" in cases 3 and 4, and subselect would be assigned "ghi"
in case 4.
I kept trying to do something like:
/calls(/%group(/%view(/%subselect)?)?)?
but never got it to work.
Thank you,
pedz
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Thu, Mar 31, 2011 at 4:13 AM, Manny 777 <lists@ruby-forum.com> wrote:
Hello there,
I'm doing a form and I want to send this form with method="post". Head
of form looks so:
<%= form_tag({ :controller => 'admin', :action => 'menu_add' }, {
:method => 'post' }) do %>
And in controller I have this:
def menu_add
menu_new = Menu.new(...)
...
end
And with I am fighting - I'm not using type of route get
'admin/menu_add' - I'm sending a form by method post -- but I am still
getting the route error "Unknown action - The action 'menu_add' could
not be found for AdminController" -- how it is possible, if I'm not
using route 'admin/menu_add' by get, but by post?
And one question yet - exist some effective way, how to work with
routes? If i want to add some new action, I must to add to file
'routes.rb' line as:
get 'admin/menu_add'
post 'admin/menu_add'
It's a bit boring to add every new action so manually... is some better
way, how to do?
Thanks a lot, Manny.
I'm not sure which version of Rails you are using so I've provided a link to a tutorial for both. I think if you read/watch them it will help to clear up a lot of the issues you are having.
Rails 2 routes
http://darynholmes.wordpress.com/2008/03/15/beginners-tutorial-routing-in-rails-20-with-rest-part-1-of-n/
Rails 3 routes
http://railscasts.com/episodes/203-routing-in-rails-3
Good luck.
B.
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi there,
I have the collection with items "name", "surname", "sequence". When
I'm saving next user to my collection, I need to get the highest value
of "sequence" in my collection, this value increment and save to new
user... but I don't know, how to get the highest value stored in
collection...
But obviously I'm getting error message about undefined local variable
sequence.
I am trying this problem to solve following:
--
high = Users.find(:order => 'sequence_at DESC', :limit => 1)
unless high.sequence.nil? || high.sequence == 0
save_seq += 1
else
save_seq = 1
end
@user_new = Users.new(:name => params[:name], :sequence => save_seq)
I will be very glad for every help!
Thanks, Manny
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 31 March 2011 14:31, paulo <paul.a.taylor84@gmail.com> wrote:
> Sorry if this has been asked before, I'm just looking for a pointer on
> the 'standard' or accepted way to get around this issue, as oppose to
> some 'bodges' that would seem workable.
>
> Dead simple:
>
> I have an index page for model 'properties' which needs a per-property
> link to create a new 'lease'. A link_to is fine for jumping to the
> 'new' page of the 'lease' model, however I want to pass the
> property_id for the lease to the controller, without it appearing in
> the url (Presuming I will thus have to POST it)
>
> I know that I could do a javascript function or create a hidden form
> but was wondering if there is a more elegant way to solve this, as it
> must crop up all of the time.
Well, really, the elegant way is to have the ID in the URL, and GET
it. It's not great practice to use POSTs when a GET would do, simply
for comestic reasons.
Is there a particular business reason you can't have the ID of the
property in the URL? If it's simply that the URL doesn't look pretty
with a querystring attached, you could make 'leases' a nested
resources, so the URLs could look like this:
/properties/1/leases/new
If it's genuinely unacceptable to have the property ID in the URL,
then you will have to send it as form data in a POST, yes. If you want
to avoid JavaScript, but still have the element look like a link
rather than a form submit button, it's possible to style buttons as
links:
http://natbat.net/2009/Jun/10/styling-buttons-as-links/
but this is starting to look like a hacky solution to a non-problem.
Can you elaborate more on what you're trying to achieve?
Chris
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
My application creates new records in a nested form. I want to record
the ip address that created the record (assuming it was created from
the controller in this way). How can I do this, given that
request.remote_ip is not accessible in the model?
Mark
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I've not heard of Mirah. Certainly like the idea though.
I have decided to drop the whole rails approach.
I had designed a rails app to act as a full point of sale
application.
It would be accessed over tablet pc browsers.
I have done some testing today accessing the web app via safari on the
ipad and the latency was terrible.
So much so, that it renders the product un-usable.
I am going to have to go full android I think.
Maybe have some backend to dump the data using some rest API.
Any advice for taking such a route?
On Mar 31, 2:18 pm, dsadaka <d...@web-site1.com> wrote:
> As opposed to running the server on the handheld, have you looked at
> writing an app using Mirah?
> It's very, very ruby-like.
>
> Mirah is a simpler Java, a Java that is fun to work with. Best of all,
> it is also already fully functional, and is just a simple gem install
> away:
>
> --http://www.igvita.com/2010/12/14/beyond-ruby-mirah-reia-rite/
>
> HTH,
> Dan
>
> On Mar 30, 5:13 am, cipher_neo <l33...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hey guys,
>
> > I am building an RoR web app that I would like to have fully contained
> > in a tablet computer.
>
> > I would like to run the server on it, and also use it as the client.
>
> > Is this possible with any tablet computers out there at the moment?
> > I really am aiming to get it working on the android tablet, but any
> > tablet that allows you to install ruby and run a server would
> > suffice.
>
> > any help appreciated!
>
> > Lee
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I just create two separate folders but have them point to the same svn
repository. Then I have a file called skin.yml (not checked in) that
contains any data that differentiates them. So the files are
duplicated, but they are always in sync because I deploy both sites in
parallel.
On Thu, Mar 31, 2011 at 2:00 PM, Norm Scherer <normscherer@earthlink.net> wrote:
> On 03/31/2011 10:17 AM, Walther Diechmann wrote:
>
> Hi,
>
> I've been googling quite a bit - but up until now to no use :(
>
> My problem is how to configure Apache conf (and perhaps Passenger) for
> this setup to work:
>
> <VirtualHost *:80>
> ServerName oxen.company_A.com
> DocumentRoot /var/www/html/oxen/sites/company_A/public
> PassengerAppRoot /var/www/html/oxen
> SetEnv OXID 23
> </VirtualHost>
>
> <VirtualHost *:80>
> ServerName oxen.company_B.com
> DocumentRoot /var/www/html/oxen/sites/company_B/public
> PassengerAppRoot /var/www/html/oxen
> SetEnv OXID 25
> </VirtualHost>
> ...et
>
> That is - I'd like a few customers run off the same codebase (which will
> segment them on the OXID) and still offer each customer 'his' own public
> with css, javascripts, images, uploaded files etc
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hello, I'm testing Google Charts API plugin for rails and have a few
questions about it's use (I searched for a developper documentation
for about an hour without founding anything really interesting):
Here is my test code:
# Testing google charts api
chart = GoogleChart.new
chart.type = :bar_vertical_stacked
chart.height = 400
chart.width = 600
chart.data = [@totalAmount, @totalPercent]
chart.colors = '346090'
chart.labels = ["total", "percent"]
@small_sales_chart_url = chart.to_url
And in the view:
<%= image_tag @small_sales_chart_url %>
The generated graph url is:
http://chart.apis.google.com/chart?chs=600x400&cht=bvs&chco=346090&chl=total|percent&chd=t:300.0,100.0
This is great, but I would like to know how to:
- Set the space between each bar
- Define the y axis labels
- Create a bar with values that can be negative
- Write the value of each bar directly on the graph
....and so many more.
If anyone knows where I could find a complete developper guide that
would be great, if not maybe you can help me with those few questions
in the meantime.
Thanks!
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
You should look at the gemsets feature of rvm. Then you can use
the .rvmrc file in each project to select a gemset (and a ruby
interpreter). After you've done this, each project will see just its
own gems. You can use bundler to manage the gems locally, too, which
makes it quite painless to deploy to the production environment for
each project and get just the set of gems needed.
-Rob
On Mar 31, 2011, at 1:27 PM, Rajesh B. wrote:
> Hi all,
>
> i have installed rails 3 using RVM . the prob is now i have two
> parallel
> projects where one is in 2.3.5 and another is in rails3.
>
> i use Mac o x 10.6.3
> mysql :Server version: 5.1.56 MySQL
>
> so can i switch in between rails3 and rails 2.3.8??
>
> this is my gem list...
>
> actionmailer (3.0.5, 3.0.5.rc1, 3.0.4, 3.0.3, 2.3.8, 2.3.5)
> actionpack (3.0.5, 3.0.5.rc1, 3.0.4, 3.0.3, 2.3.8, 2.3.5)
> activemodel (3.0.5, 3.0.5.rc1, 3.0.4, 3.0.3)
> activerecord (3.0.5, 3.0.5.rc1, 3.0.4, 3.0.3, 2.3.8, 2.3.5)
> activeresource (3.0.5, 3.0.5.rc1, 3.0.4, 3.0.3, 2.3.8, 2.3.5)
> activesupport (3.0.5, 3.0.5.rc1, 3.0.4, 3.0.3, 2.3.8, 2.3.5)
> addressable (2.2.4)
> .
> .
> .
> .
> .
> .
> rack-openid (1.2.0)
> rack-test (0.5.7, 0.5.6)
> rails (3.0.5, 3.0.5.rc1, 3.0.4, 3.0.3, 2.3.8, 2.3.5)
> railties (3.0.5, 3.0.5.rc1, 3.0.4, 3.0.3)
> rake (0.8.7)
> RedCloth (4.2.7)
> .
> .
> .
> ----------------
>
> when i say "rails -v" it shows..
>
> static-177:~ rathod$ rails -v
> Rails 3.0.5
>
> ----------------
>
>
>
> Please help me i should run the 2.3.5 code in my machine..
>
> --
> 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 email to rubyonrails-talk+unsubscribe@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
> .
>
Rob Biedenharn http://agileconsultingllc.com
Rob@AgileConsultingLLC.com
+1 513-295-4739
Skype: rob.biedenharn
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I found a solution that uses fixtures and executes the tests without any
errors. I wrote a short article at:
http://www.faustas.de/rails-test-error-beforefilter-loginrequired-controller
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks Jeffrey L. Taylor
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Knewton is looking for talented Software Engineers with superior
problem solving and coding skills. Based in NYC's Union Square,
Knewton is poised to revolutionize the practice of education with the
world's most powerful adaptive learning engine. We are a startup rich
in eclectic personalities, are ridiculously dedicated and are unified
around a passion for democratizing education. We have also been
recognized as a Technology Pioneer for 2011 from the World Economic
Forum in Davos and one of the 25 best places to work by Crain's New
York Business.
What we need from you is experience with:
• RubyonRails
• Creating clean, elegant code
• MySQL
• Creating RESTful interfaces
• Building web platforms
• Strong communication skills
• A start-up mentality and work ethic
Bonus:
• Amazon Web Services experience
• NIX experience
• Agile Development experience
• Javascript
• machine learning
• Python
Your role: You'll be working to implement innovative new features
that get in front of customers quickly.
If you would like to be considered for this opportunity, please e-mail
techjobs@knewton.com and attach a resume.
For more information, please email victor@knewton.com
Perks include huge monitors, macs, a kitchen filled with your favorite
treats, flexible hours, frequent guest speakers, excellent health
benefits, equity and a chance to do meaningful, cutting edge work in a
dynamic environment.
Knewton, Inc.
19 Union Square West, New York, NY 10003
http://www.knewton.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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Knewton is looking for a talented Software Engineering Director with
superior leadership, problem solving and coding skills. We have a team
of extremely smart, talented and (ahem) opinionated engineers. We need
someone who is going to know when to steer and guide our engineers and
know when to get out of their way. Your experience in building high
performance, scalable, automatically tested, frequently improving
websites will serve as the perfect complement to our team's
capabilities.
Based in NYC's Union Square, Knewton is poised to revolutionize the
practice of education with the world's most powerful adaptive learning
engine. Today, our revenues come from our proprietary test prep
classes, but we will soon open up our platform to major education
companies. We have been recognized as a Technology Pioneer for 2011
from the World Economic Forum in Davos and voted one of the 25 "Best
Places to Work" by Crain's New York Business.
We are a startup in every sense: rich in eclectic personalities and
disgustingly dedicated. Our intention is to democratize education.
Yes, that is a lofty goal, and so we are expanding our team.
We need the following from you:
You must have led a team of software engineers in an Agile environment
You must have expert-level Ruby development experience
You must have a start-up mentality and work ethic
You must have worked at a large-scale web property
Bonus:
Continuous deployment (or you can simply release your code to
production in an automated fashion at anytime)
Amazon Web Services experience
Machine learning
Start-up life can be intense, but it's not without its perks: macs,
huge monitors, excellent benefits, and a snack closet filled with your
favorite treats.
If you are interested in being considered for this opportunity, please
e-mail techjobs@knewton.com and attach a resume
For additional info, please contact victor@knewton.com
Knewton, Inc.
19 Union Square West, New York, NY 10003
http://www.knewton.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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mar 30, 10:10 am, Heinz Strunk <li...@ruby-forum.com> wrote:
> Hey folks,
>
> I have two different Rails apps and I would like t o sync the user
> databases. What's the best way to do that? I thought of whenever someone
> registers with one app the user information is posted to the other app
> and vice versa. What would you use for that? JSON? Sinatra?
>
> Thanks for the help!
>
> --
> Posted viahttp://www.ruby-forum.com/.
Are you talking about the whole database or just the users table? The
way I read your post it looks like you just want to validate users and
keep only one table for all users. If that is the case why not set up
a connection in the application that does not own the users table that
is only used by the User model? That should be enough to give you
access to the user information you might need.
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I know that I could do a javascript function or create a hidden form
but was wondering if there is a more elegant way to solve this, as it
must crop up all of the time.
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 30 March 2011 20:06, Coderama <prime.coderama@gmail.com> wrote:
> I want to save my datetime and display it using a user's TimeZone
> ignoring DST at all times. Is this possible?
Do you know what the user's timezone is? If so then take the timezone
offset (which is distinct from the DST setting) and calculate the time
accordingly.
Colin
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I am posting a related question in the same thread.
It is more of a philosophical question.
Can anybody please give me some philosophical explanation why the
following behavior of ActiveRecord is considered ok (or should i submit
a bug report/feature request?):
In console:
> p = Person.create(:name=>'Bill')
> p.destroy
> p.name # => "Bill"
> p.save # => true
Nothing is saved in the database, but what disturbs me more is that
"save" returned true in such case.
A more elaborate version:
> p = Person.create(:name=>'Bill')
> p.id # => 1
> pp = Person.find(1)
> pp.destroyed
> p.persisted? => true
> p.destroyed? => false
> p.save # => true
but the database is empty.
Again, what bothers me the most is the "true" returned by "save".
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.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mar 30, 2:06 pm, Coderama <prime.coder...@gmail.com> wrote:
> I want to save my datetime and display it using a user's TimeZone
> ignoring DST at all times. Is this possible?
Rather than storing a timezone string you could just store the offset,
so since I'm in "Central Time US & Canada" I would just use "-0600"
which would avoid DST when we switch to -0500.
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi All,
Sorry if this has been asked before, I'm just looking for a pointer on
the 'standard' or accepted way to get around this issue, as oppose to
some 'bodges' that would seem workable.
Dead simple:
I have an index page for model 'properties' which needs a per-property
link to create a new 'lease'. A link_to is fine for jumping to the
'new' page of the 'lease' model, however I want to pass the
property_id for the lease to the controller, without it appearing in
the url (Presuming I will thus have to POST it)
I know that I could do a javascript function or create a hidden form
but was wondering if there is a more elegant way to solve this, as it
must crop up all of the time.
Thanks in advance for any helpers with this
Paul
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
See if TimeZone.period_for_local works for you. It has a DST=false parameter.
--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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
If you have multiple elements on your page that have the literal value
name="algo" then the last one will "win" and only that one value will
be submitted to the server by the browser. If they are actually
name="algo[]", then you will receive an array of values for algo and
you can iterate over them on the server with each(). In Prototype, you
can get all of the values for the current form in one serialized
string like this (inside your Ajax Request):
... parameters: this.up('form').serialize(), ...
Then your controller method can pick out the ones you want
with :params[:algo] or something like that.
Walter
On Mar 31, 2011, at 8:46 AM, Tobias H. wrote:
> Thanks for the fast request.
>
> Do you also know how it's possible to read all values of different
> selectboxes in different div-tags (but all with the same name "algo")
> with prototype: Is there a way to loop over all those div-tags and
> read
> the value of the selectbox in each div-tag?
>
> --
> 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 email to rubyonrails-talk+unsubscribe@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
> .
>
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
As opposed to running the server on the handheld, have you looked at
writing an app using Mirah?
It's very, very ruby-like.
Mirah is a simpler Java, a Java that is fun to work with. Best of all,
it is also already fully functional, and is just a simple gem install
away:
-- http://www.igvita.com/2010/12/14/beyond-ruby-mirah-reia-rite/
HTH,
Dan
On Mar 30, 5:13 am, cipher_neo <l33...@gmail.com> wrote:
> Hey guys,
>
> I am building an RoR web app that I would like to have fully contained
> in a tablet computer.
>
> I would like to run the server on it, and also use it as the client.
>
> Is this possible with any tablet computers out there at the moment?
> I really am aiming to get it working on the android tablet, but any
> tablet that allows you to install ruby and run a server would
> suffice.
>
> any help appreciated!
>
> Lee
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi All,
Apologies if this is verging on O/T for the list, but I do see some job ads and I've been trying to contribute substantively to the list for the last couple of months.
I'm in the horrible position of having too much work, but some of it isn't that profitable so I can't go to my regular guys who are $100+/hr. Simple content management systems, etc. All in Rails 3.0.x with Ruby Enterprise 1.8.7 being deployed on Heroku using SendGrid, etc. I need someone to create a good first cut of sites. They need to use rvm, use git and create meaningful commit messages every 15 mins to 2 hours as they complete discrete chunks of work, name their fields and classes intelligently, keep method sizes low (most 6-8 lines, all under 20 or so). They need to know Devise for authentication, Cancan for authorization, Paperclip (with S3) for file uploads on Heroku and be equally comfortable with haml and erb. They also need to naturally write at least some acceptance tests first using cucumber and capybara, and write some rspec tests for any areas of business complexity. I'm not looking for high levels of coverage in rcov, but a decent effort to have some degree of smoke testing of the app which we can upgrade over time. Some of the apps may need a little jQuery loving, but nothing too complex.
I have a specific project now, and then 2-3 a month coming down the line. Anyone who feels they meet the criteria and would like to build a relationship, please drop me a line off-list (peter@pbell.com) with some information about yourself and your rates. To give you an idea, depending on your productivity this is the kind of work that would make sense at maybe $20-25/hr assuming you can knock out sites pretty quickly, so it's either offshore or "beer money" work. Eventually I'd want to just pay hourly so we're both focused on doing things both well and quickly, although I might give some specific well specified stories for a fixed bid to try things out on the first project.
And now back to our regularly scheduled tech conversations - apologies for the interruption.
Best Wishes,
Peter
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Did you have any luck with this, Oliver?
I've encountered exactly the same problem. Should we reported this as
a bug?
On Mar 7, 12:08 pm, olivernn <oliver.nightinga...@gmail.com> wrote:
> I appreciate the discussion on the pros and cons of exporting to csv,
> however my question was more to do with what the expected behaviour of
> respond_with is when the request format is csv.
>
> I would have thought that since the object I am passing to
> respond_with has a to_csv method that it wouldn't also need a template
> to return a response, much like a json, xml or yaml request. Is this
> not the expected behaviour? Maybe a bug in rails, or just something
> that could do with some more documentation?
>
> From ActionController::Responder
>
> # When a request comes in, for example for an XML response, three
> steps happen:
> #
> # 1) the responder searches for a template at people/index.xml;
> #
> # 2) if the template is not available, it will invoke
> <code>#to_xml</code> on the given resource;
> #
> # 3) if the responder does not <code>respond_to :to_xml</code>,
> call <code>#to_format</code> on it.
>
> On Mar 7, 1:43 am, Julian Leviston <jul...@coretech.net.au> wrote:
>
>
>
> > I agree with you, though I find it amusing when people export things to csv just to run totals. So, it's important to work out just why they want it in csv
>
> > Blog:http://random8.zenunit.com/
> > Twitter:http://twitter.com/random8r
> > Learn:http://sensei.zenunit.com/
> > New video up now athttp://sensei.zenunit.com/realfastcgi rails deploy process! Check it out now!
>
> > On 07/03/2011, at 12:18 AM, Adam Solove <asol...@gmail.com> wrote:
>
> > > I'd like to strongly disagree. While csv is not a great way to send
> > > objects back and forth, it is a fantastic way to give reports to
> > > users, since they can play around with them in Excel.
>
> > > On Mar 5, 9:03 am, marco <marcofog...@gmail.com> wrote:
> > >> All right, but, before, why would you do that? I think if you really
> > >> need to use csv (eg. some legacy system), you would rather want to
> > >> read from the csv file, turn it into object and serialize it with
> > >> JSON. In the other end you'd do the opposit. I don't think csv is a
> > >> good format to respond with, just a persistency format, very limited
> > >> by the way.
>
> > >> On Mar 4, 1:22 pm, olivernn <oliver.nightinga...@gmail.com> wrote:
>
> > >>> In my controller I have an instance of a custom report class, the
> > >>> instance responds to to_csv, which returns a csv string. I was hoping
> > >>> to be able to use respond_with, in the same way I would if I wanted a
> > >>> json representation of this object. Instead I see an error because
> > >>> Rails is expecting there to be a template.
>
> > >>> ActionView::MissingTemplate (Missing template admin/reports/trips with
> > >>> {:formats=>[:csv], :handlers=>[:erb, :builder, :rjs, :rhtml, :rxml], :locale=>[:en, :en]}
> > >>> in view paths
>
> > >>> Is this the correct behaviour, I had a brief look through the rails
> > >>> responder code and it looked to me like it should first try and render
> > >>> a template, then if it can't find one try calling to_#{format}.
>
> > >>> A sample of my code is in this gisthttps://gist.github.com/854903
>
> > > --
> > > 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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
> > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks for the fast request.
Do you also know how it's possible to read all values of different
selectboxes in different div-tags (but all with the same name "algo")
with prototype: Is there a way to loop over all those div-tags and read
the value of the selectbox in each div-tag?
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Its not clear what you need or why you can't just call two different
inserts. But maybe a callback as after_create will help you.
class User
after_create :create_blog
def create_blog
Blog.create(:title => self.name)
end
end
On Mar 30, 4:48 pm, Payal Patel <li...@ruby-forum.com> wrote:
> how would you execute 2 insert calls in just one database call in
> controller...eg Inserting a record in Users and Blogs tables using just
> one database/active record call.
>
> --
> Posted viahttp://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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mar 31, 2011, at 7:10 AM, Tobias H. wrote:
> Hey guys,
>
> i've the following question:
> how can i parse the value of a selectbox within a div-tag (with the id
> "ma") via AJAX and use the parsed value for reading out some data from
> my database. the parsing request should be started by selecting
> another
> selectbox.
>
> My mainquestion is: how can i parse a selectbox (if possible with rjs)
> an get the value in ruby (not just in javascript) for further actions
> (like reading out some data from database)?
You have to have JavaScript in your page which will respond to the
'change' event on your selectbox by sending an Ajax request to your
server. At that point, it will be a normal Rails request, and you'll
have the values. Your server will respond with the result. There are
helpers (or used to be in Rails 2) to generate this JavaScript for
you, but it's important to understand that you can't (from Ruby, in
Rails) ask the browser anything. You have to be waiting for it to ask
things of you.
The Prototype-flavored JavaScript to do this would be something like
this:
$('mySelectBoxId').observe('change',function(evt){
new Ajax.Request('your/server/endpoint',{
parameters:{mySelectBox:this.getValue()},
onSuccess:function(transport){
//do something with
transport.responseText
},
onFailure: function(transport){
//sad face
}
});
});
You can probably get similar code injected into your page for you by
one of the Rails helpers, but that's the basic mode by which it will
work.
Walter
>
> thank you for your response!
>
> Tobe
>
> --
> 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 email to rubyonrails-talk+unsubscribe@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
> .
>
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I think this is just basic to how Rails works. The controller responds
to requests with methods. Those methods may be further decomposed into
other methods and variable values, but your statement is true as far
as I understand it.
Walter
On Mar 31, 2011, at 6:50 AM, Albert Català wrote:
> --> And this is weird, ¿ or not ? the X method is used for two
> porpuses:
> as a response of a browser JS request, and as "function"
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hey guys,
i've the following question:
how can i parse the value of a selectbox within a div-tag (with the id
"ma") via AJAX and use the parsed value for reading out some data from
my database. the parsing request should be started by selecting another
selectbox.
My mainquestion is: how can i parse a selectbox (if possible with rjs)
an get the value in ruby (not just in javascript) for further actions
(like reading out some data from database)?
thank you for your response!
Tobe
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi
I store paypal api username, password and signature as simple text in
config/app_config.yml. I would like to know whether this can be
protected , than just storing it as text which anybody can read from
app_config.yml.
Thanks
Tom
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thanks for your response, sorry but my unknows go far away:
I have two entitys:
1- Views or Partial: and I undersant this: render :partial /shred/foo
2- Method/controller (X). now I place this method in
application_controller and the .js.rjs in views/application/X.js.rjs. It
works
But I do that because in "menu" controller and "Maintenance" contoller I
call X, but not as a "redirecto_to" otherwise as a normal call, as if it
was a function, only to initialize variables.
So that, I need to put X method in applicationController, to be seen
from the others controllers (menu and Maintenance).
--> And this is weird, ¿ or not ? the X method is used for two porpuses:
as a response of a browser JS request, and as "function"
And to tho that I put in X:
if request.xhr?
respond_to do |format|
format.js
end
end
thanks again
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hello there,
I'm doing a form and I want to send this form with method="post". Head
of form looks so:
<%= form_tag({ :controller => 'admin', :action => 'menu_add' }, {
:method => 'post' }) do %>
And in controller I have this:
def menu_add
menu_new = Menu.new(...)
...
end
And with I am fighting - I'm not using type of route get
'admin/menu_add' - I'm sending a form by method post -- but I am still
getting the route error "Unknown action - The action 'menu_add' could
not be found for AdminController" -- how it is possible, if I'm not
using route 'admin/menu_add' by get, but by post?
And one question yet - exist some effective way, how to work with
routes? If i want to add some new action, I must to add to file
'routes.rb' line as:
get 'admin/menu_add'
post 'admin/menu_add'
It's a bit boring to add every new action so manually... is some better
way, how to do?
Thanks a lot, Manny.
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 31 Mar 2011, at 02:08, kwb <kylewbock@gmail.com> wrote:
> A little background.
>
> We are deploying a rails app on jboss by using warbler and the app is
> using rails 3.0.3.
>
> There are several parameters the customer may need to change. Some of
> these parameters include database connection information, ie shema,
> username, password, host, port, and database. We are connecting
> through oracle thorugh the jdbc adapter.
>
> My problem lies in the fact that I cannot insert ruby/jruby code into
> the database.yml file so I need to be able to specify connection
> information somewhere in the ruby code.
>
> In application.rb i have tried the following after printing the public
> methods on config
>
> config.database_configuration = {
> :adapter => 'jdbc',
> :driver => 'oracle.jdbc.driver.OracleDriver',
> :url => 'jdbc:oracle:think@host:1521:dbname',
> :username => 'username',
> :password => 'password'
> }
>
> I'm not sure if this is the right way (or place) to do this but any
> help you can give me would be greatly appreciated
You can put ERb into your database.yml, and Rails will evaluate it before loading the YAML.
Not sure if this is the best solution for you, though. I think that depends on exactly how you intend your customer to edit these settings. But it's an option.
Chris
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
yes, the full stack would be required.
I am using rails3 btw.
On Mar 31, 7:39 am, Igor Spivak <ispi...@gmail.com> wrote:
> are you looking for the full rails stack? Or would a ruby-based MVC stack
> work for you? Look athttp://rhomobile.com/.
> I have used them in the past, and they do what you want, but its not a full
> rails stack, more like a ruby-mvc subset.
>
> -igor
>
>
>
>
>
>
>
> On Wed, Mar 30, 2011 at 11:37 PM, cipher_neo <l33...@gmail.com> wrote:
> > thanks for your reply.
>
> > I think you are right in what you say. It would be too much of a
> > memory hog to do such a thing.
>
> > I will have to have a dedicated server for the hosting of the RoR app.
>
> > I am building a point of sale system where the interface is html on a
> > tablet pc, so I was digging into my options.
>
> > May be best to just access a small linux server over wifi.
>
> > On Mar 30, 2:18 pm, Walter Lee Davis <wa...@wdstudio.com> wrote:
> > > I'm not aware of such a beast, but one thing to consider is memory and
> > > processing speed. We use Rails because it maximizes our (developer)
> > > productivity, and it does so at a cost of requiring a fairly studly
> > > server to run the back-end. I haven't tried running RoR on anything
> > > less than a 1/2 GB VPS.
>
> > > Now when I was just starting out in this tech wheeze, I had an off-
> > > cast SE/30 running some Mac Web server, and it was pretty darned quick
> > > on the local network. A pal of mine had installed Unix on his, and
> > > hooked it to a T1, and could saturate the T with upstream traffic from
> > > Apache. But that's static service, nothing dynamic. That SE/30, with
> > > its 16MHz 68030 processor, 1 whole Megabyte of RAM, and creaky-slow
> > > SCSI 1 hard disk could be speedier than the network when the task was
> > > sized to it, but try to get it to also run a database server, an
> > > application server, etc. at the same time as all those Web requests,
> > > and you would have had a sad little putty-colored puddle.
>
> > > Now you're talking about running the server AND the browser in the
> > > same memory- and process-limited environment. I don't think it's
> > > realistic to expect this to work well or even at all. I use a beefy
> > > Mac laptop to do the same thing for development purposes, but that's
> > > orders of magnitude more processing power, available RAM, and storage
> > > for data and swap. It's just not even in the same universe. And even
> > > that beast can be quite noticeably slower than the same app running
> > > from SliceHost over my network connection.
>
> > > Walter
>
> > > On Mar 30, 2011, at 5:13 AM, cipher_neo wrote:
>
> > > > Hey guys,
>
> > > > I am building an RoR web app that I would like to have fully contained
> > > > in a tablet computer.
>
> > > > I would like to run the server on it, and also use it as the client.
>
> > > > Is this possible with any tablet computers out there at the moment?
> > > > I really am aiming to get it working on the android tablet, but any
> > > > tablet that allows you to install ruby and run a server would
> > > > suffice.
>
> > > > any help appreciated!
>
> > > > Lee
>
> > > > --
> > > > 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 email to
> > rubyonrails-talk+unsubscribe@googlegroups.com
> > > > .
> > > > For more options, visit this group athttp://
> > groups.google.com/group/rubyonrails-talk?hl=en
> > > > .
>
> > --
> > 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 email to
> > rubyonrails-talk+unsubscribe@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/rubyonrails-talk?hl=en.
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 30 March 2011 16:45, John Merlino <lists@ruby-forum.com> wrote:
> Thanks for all the responses. My understanding it's breaking when I try
> to pass nothing as an argument to that function because you can't pass
> an undefined variable as an argument.
What's the error message you get? "divide by zero"? or "1 parameter for 2"?
You earlier said:
> Sometimes the value can be empty - not null, not
> integer, just empty because when user updates record they clear out
> field and update it.
>
> = render "dashboard/progressbar.html", :value =>
divide_numbers(actual.to_f, expected), :
In this event, you *are* passing two parameters to the method, one as
a float (which, if it started as an empty string, will be turned to
0.0) and the expected value, which may be nil (or an empty string), or
a number. Is there anywhere you are ensuring it's a float like you do
the "actual" value?
Maybe try:
divide_numbers(actual.to_f, expected.to_f)
...to get more consistent results from a range of input values.
BTW, have a play in the console too, to see what different
combinations give you:
>> 2/0
ZeroDivisionError: divided by 0
>> 2/""
TypeError: String can't be coerced into Fixnum
>> 2/nil
TypeError: nil can't be coerced into Fixnum
>> 2/0.0
=> Infinity
>>
...try that with your divide_numbers method...
HTH
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
yes, the full stack would be required.
I am using rails3 btw.
regards,
Lee Farrell
are you looking for the full rails stack? Or would a ruby-based MVC stack work for you? Look at http://rhomobile.com/.
I have used them in the past, and they do what you want, but its not a full rails stack, more like a ruby-mvc subset.
-igorOn Wed, Mar 30, 2011 at 11:37 PM, cipher_neo <l33z3r@gmail.com> wrote:thanks for your reply.
I think you are right in what you say. It would be too much of a
memory hog to do such a thing.
I will have to have a dedicated server for the hosting of the RoR app.
I am building a point of sale system where the interface is html on a
tablet pc, so I was digging into my options.
May be best to just access a small linux server over wifi.
> > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en
On Mar 30, 2:18 pm, Walter Lee Davis <wa...@wdstudio.com> wrote:
> I'm not aware of such a beast, but one thing to consider is memory and
> processing speed. We use Rails because it maximizes our (developer)
> productivity, and it does so at a cost of requiring a fairly studly
> server to run the back-end. I haven't tried running RoR on anything
> less than a 1/2 GB VPS.
>
> Now when I was just starting out in this tech wheeze, I had an off-
> cast SE/30 running some Mac Web server, and it was pretty darned quick
> on the local network. A pal of mine had installed Unix on his, and
> hooked it to a T1, and could saturate the T with upstream traffic from
> Apache. But that's static service, nothing dynamic. That SE/30, with
> its 16MHz 68030 processor, 1 whole Megabyte of RAM, and creaky-slow
> SCSI 1 hard disk could be speedier than the network when the task was
> sized to it, but try to get it to also run a database server, an
> application server, etc. at the same time as all those Web requests,
> and you would have had a sad little putty-colored puddle.
>
> Now you're talking about running the server AND the browser in the
> same memory- and process-limited environment. I don't think it's
> realistic to expect this to work well or even at all. I use a beefy
> Mac laptop to do the same thing for development purposes, but that's
> orders of magnitude more processing power, available RAM, and storage
> for data and swap. It's just not even in the same universe. And even
> that beast can be quite noticeably slower than the same app running
> from SliceHost over my network connection.
>
> Walter> > --
>
> On Mar 30, 2011, at 5:13 AM, cipher_neo wrote:
>
>
>
>
>
>
>
> > Hey guys,
>
> > I am building an RoR web app that I would like to have fully contained
> > in a tablet computer.
>
> > I would like to run the server on it, and also use it as the client.
>
> > Is this possible with any tablet computers out there at the moment?
> > I really am aiming to get it working on the android tablet, but any
> > tablet that allows you to install ruby and run a server would
> > suffice.
>
> > any help appreciated!
>
> > Lee
>
> > 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 email to rubyonrails-talk+unsubscribe@googlegroups.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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
--
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 email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.