Ruby on Rails Sunday, August 31, 2014

As colin mentioned, this is an active record relation that looks like a card. I believe it's actually an association proxy (I dont have the rails code open here)

Also, in rails, best practice is to operate on duck types, not strict types. You should never have to is_a? anything. This hints at design flaws within your application.

Remember, .class is simply a method defined on an object and can be overriden too.

On Saturday, August 30, 2014 6:21:48 AM UTC-7, Ruby-Forum.com User wrote:
Rails 4, Ruby 2

Model has Card and Idiom
and Idiom belongs_to :card

In my Rails console I have an Idiom i and get the card from it:

    c=i.card

 => #<Card id: 19, ....>

Now I do:

    c.is_a?(Card)
 => false

    c.instance_of?(Card)
 => false

Ooops! Why false in both cases?

    c.class.name
 => "Card"
    c.class.name==Card.name
 => true

The class name is the same, but the class isn't? Please explain....

And now an explanation why I want to do it:

I have a function which is "overloaded", in that it's single argument
can be either of a certain clas (in my case, Card (or a subclass of
it)), or a Fixnum, and I need to distinguish between these cases.

I know that it is not the best style of querying the type of a variable
at runtime, but the only alternatives I could think of, would be to
either provide two differently named functions, or have an hash argument
with two types of keywords, and I don't like both of these solutions.
Aside from this, I'm really curious to know why is_a? doesn't  work
here.

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/963eaa9e-323f-4aa8-a70d-ed74c3e75291%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

The routes don't matter here.

Firstly, it should be @comment = @post.comments.create instead of build, no point in building something and saving it afterwards.

Secondly, the comment won't be created because the parameters for the comment are not being sanitized. If rails allowed you to do what you are wanting to do here it would be a terrible security issue.

See http://edgeapi.rubyonrails.org/classes/ActionController/StrongParameters.html
On Saturday, August 30, 2014 5:40:35 PM UTC-7, Ruby-Forum.com User wrote:
I am trying to create my first ever program Using Ruby programming
language on Ruby on Rails and it is a blog! I am following a tutorial
and have created a comments box which does NOT print the comment on the
page so far when written in the comments box, that's the problem. I will
explain step by step I have:

1. Called out on routes.rb:

resources :posts do
resources :comments
end

2. Called out using Cmder:
rails g controller comments create destroy


3. This is my comments_controller.rb class:

class CommentsController < ApplicationController
  def create
    @post = Post.find(params[:post_id])
    @comment = @post.comments.build(params[:comment]) #around here is
the error
    @comment.save

    redirect_to @post
  end

  def destroy
  end
end



can anybody please help?

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/fdeed190-29d5-46d3-ae41-a5199b9575d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I think it reminds me of stained glassed windows in churches! :)

https://www.google.com.my/search?q=church+stained+glass&espv=2&source=lnms&tbm=isch&sa=X&ei=EfIDVISxMsHc8AWPy4HgAg&ved=0CAYQ_AUoAQ&biw=1440&bih=779

On Sunday, August 31, 2014 9:01:38 AM UTC+8, Designby Lefty wrote:
What do you think guys ????? i think the Shiny Door is (sorry for the modesty) a great finding because soooo true.


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f1305b4b-113f-4a7d-9581-fdb8c48a42e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hassan Schroeder wrote in post #1156455:
> On Sun, Aug 31, 2014 at 10:17 AM, David Williams <lists@ruby-forum.com>
> wrote:
>
>> feature that gives users the ability to create web pages (predefined
>> drag and drop items included), and then I would like to present those
>> web pages on my domain with the link of that person's name.
>> www.example.com/jennycraig. I can't seem to find the gem for this
>> feature, but it has existed for at least 4 years now.
>
> Still not too clear on the "drag and drop items" but are you talking
> about a CMS? Have you looked at:
>
> https://www.ruby-toolbox.com/categories/content_management_systems
>
> Or perhaps something else on ruby-toolbox will be helpful. Though
> honestly, what you're describing (caveat: as far as I understand it!)
> doesn't sound particularly complex.
>
> --
> Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
> http://about.me/hassanschroeder
> twitter: @hassan

The CMS gems available are mainly for blog creations. And what I meant
by "drag and drop" is giving the user the ability to embed html elements
into the web page itself. I'll continue to search around. Maybe, I'll
find something on github.

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8e8d1235673e4d880258c151d39d2e3f%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Personally, I think this is the coolest looking one.
http://designmodo.com/wp-content/uploads/2014/06/rails.jpg If they
edited it to have the text, it would be perfect!

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d5cd397506158421774a96ddd9bf7618%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hey,

Any plans to backport Active Job to earlier versions of Rails?  This would be super useful for external gems.  If not, I'll take a stab at it.

Thanks,
Andrew

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7b185c43-d38e-4635-8227-b8d2f3214f00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I'm a little confused about how one is supposed to create an ordered hash.  As far as I can tell, ActiveSupport::OrderedHash does not provide a constructor or a method that can create a hash from an array of pairs.  Is this a deliberate ommission?  Hash also doesn't provide this, although later versions of ruby provide .to_h on an array as a way of generating a hash.  Why isn't there an OrderedHash.from_a(<array of key, value pairs> method?  Why not, perhaps, have ActiveSupport patch Array to provide a ".to_ordered_h" method on an array?  If there's an obvious way to create an ordered hash, please let me know about it, and my apologies if this has been discussed before (I couldn't find any discussion of it myself).  FWIW, my particular application was converting an ordered CsvRow to an ordered hash, which seem to involve my code than I felt should be necessary.


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ddb671ea-c926-4ab8-9722-d1d60b07182e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On 31 August 2014 18:16, Thomas O'Boyle <thomashoboyle@gmail.com> wrote:
> Thanks for replying Colin. I added the "has_many: cars" line in

There is the problem then, it should be has_many :cars, not has_many:
cars. If you think that is what you have got then copy/paste user.rb
here.

Colin

> app/models/user.rb just like the instructor. With the attr_accessible part,
> everything is exactly as it is in the tutorial. I have gone through the
> project serval times to insure that I am doing everything right and get the
> same issues every time.
>
> Thanks again for replying!
>
> On Sunday, August 31, 2014 10:00:16 AM UTC-7, Colin Law wrote:
>>
>> On 31 August 2014 17:29, Thomas O'Boyle <thomas...@gmail.com> wrote:
>> > Hi Nobert,
>> >
>> > Thanks for responding to my question. I have completely followed his
>> > steps
>> > until the restart part. I did notice that when the instructor adds
>> > attributes such as :condition and :year that they automatically appear
>> > in
>> > sublime, but when I check my work in atom the attr_accessible does not
>> > appear. Could this be the issue?
>>
>> You did not answer the question as to whether you have added the line
>> has_many :cars in app/models/user.rb?
>> As to the issue with attr_accessible, you have to make sure that your
>> code is the same as the one in the tutorial.
>>
>> Colin
>>
>>
>> >
>> > Thanks again for responding!
>> >
>> > On Sunday, August 31, 2014 1:26:24 AM UTC-7, Norbert Melzer wrote:
>> >>
>> >> Have you followed his steps and changed your model? In other words,
>> >> have
>> >> you added the line has_many :cars in app/models/user.rb?
>> >>
>> >> Am 31.08.2014 09:42 schrieb "Thomas O'Boyle" <thomas...@gmail.com>:
>> >>>
>> >>> Hi All,
>> >>>
>> >>> I just started the UT on Rails class through reddit and am completely
>> >>> new
>> >>> to programing. I apologize for not being able to articulate my
>> >>> problem
>> >>> clearly. I am watching this video
>> >>> https://www.youtube.com/watch?v=EU98yHB-_7A and at 16:18 when the
>> >>> instructor
>> >>> restarts something (terminal) I get completely lost. He consules back
>> >>> into
>> >>> rails after this restart but when I do this I get this:
>> >>>
>> >>> "User.last.cars
>> >>>
>> >>> User Load (0.4ms) SELECT "users".* FROM "users" ORDER BY
>> >>> "users"."id" DESC LIMIT 1
>> >>>
>> >>> NoMethodError: undefined method `cars' for #<User:0x00......."
>> >>>
>> >>>
>> >>> I apologize again for the poorly asked question but I am really new
>> >>> with
>> >>> all of this.
>> >>>
>> >>> Thanks so much!
>> >>>
>> >>>
>> >>> Happy labor day!
>> >>>
>> >>> --
>> >>> You received this message because you are subscribed to the Google
>> >>> Groups
>> >>> "Ruby on Rails: Talk" group.
>> >>> To unsubscribe from this group and stop receiving emails from it, send
>> >>> an
>> >>> email to rubyonrails-ta...@googlegroups.com.
>> >>> To post to this group, send email to rubyonra...@googlegroups.com.
>> >>>
>> >>> To view this discussion on the web visit
>> >>>
>> >>> https://groups.google.com/d/msgid/rubyonrails-talk/4e8763a7-5235-400e-af07-209a44a5c30b%40googlegroups.com.
>> >>> For more options, visit https://groups.google.com/d/optout.
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Ruby on Rails: Talk" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an
>> > email to rubyonrails-ta...@googlegroups.com.
>> > To post to this group, send email to rubyonra...@googlegroups.com.
>> > To view this discussion on the web visit
>> >
>> > https://groups.google.com/d/msgid/rubyonrails-talk/94d15c75-9b8d-4b75-90d7-5d7671f52217%40googlegroups.com.
>> >
>> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/824b8158-af90-491b-b49e-ea416924f516%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLsYBf508sVSVkeotha1f2yhSq5F5z5L-QTX3PEoHLVeJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On Sun, Aug 31, 2014 at 10:17 AM, David Williams <lists@ruby-forum.com> wrote:

> feature that gives users the ability to create web pages (predefined
> drag and drop items included), and then I would like to present those
> web pages on my domain with the link of that person's name.
> www.example.com/jennycraig. I can't seem to find the gem for this
> feature, but it has existed for at least 4 years now.

Still not too clear on the "drag and drop items" but are you talking
about a CMS? Have you looked at:

https://www.ruby-toolbox.com/categories/content_management_systems

Or perhaps something else on ruby-toolbox will be helpful. Though
honestly, what you're describing (caveat: as far as I understand it!)
doesn't sound particularly complex.

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yAcCj%2BT3B3P%2BA%2BQRJSCO8hmveh88HmjJx5KyiHx9JQiZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On Sun, Aug 31, 2014 at 12:16 PM, Walter Lee Davis <waltd@wdstudio.com> wrote:

>> But you will need to add these fields to your form and your show and index page manually if you want to use them.

Also, in Rails 4.x:
http://edgeguides.rubyonrails.org/action_controller_overview.html#strong-parameters

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yBWHaWL8wwKwk2%3D6XeX86-gwvYnHc%3DR9Cy6CV4Oxc_Ezw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On Aug 31, 2014, at 1:18 PM, Balamurali Krishna wrote:

> I am trying to learn Ruby on Rails, so this may be a pretty basic
> question.
>
> I have added new columns to an existing table using
> 'rails generate migration add_column_to_table' command.
>
> I don't see any change in model & view due to this.
>
> So, I changed the all the views (like _form.html.erb & index.html.erb)
> to include a new form element like:
> <%= f.label :filename %><br>
> <%= f.text_field :filename %>
>
> where :filename was the new column.
>
> When I run the rails, while the new column comes on UI, it doesn't get
> saved into db. I think the binding between View and Model is missing.
>
> Is there a way to add a new column in the table to all layers
> (view/controller/model etc) apart from the db.

The scaffold generator only runs once, and it generates static files that you may edit yourself later. There was a time (in the pre -1.0 and 1.x era of Rails) when the scaffold was a live reflection of the database, and let you do things like you describe here -- change the database and the scaffold UI would change to reflect that. It hasn't worked that way for many years now.

If you open the Rails console, you will find that adding these columns to your database did create new methods in the model for you. If you added the filename to your database, then you would find that you could do YourModel.filename = "foo.bar" and that would work, and then you could read that back, and you could check if it had been set with filename? or save the model and get that value back later from the database. But you will need to add these fields to your form and your show and index page manually if you want to use them.

Like the dealer says, "first taste is free", and after that you have to break out your text editor and add some fields and outputs yourself.

Walter

>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/080c37def7708ef100f8e76a87b9abc1%40ruby-forum.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/939342EE-A762-494F-8B78-B6FFE2534908%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails


I am new to Rails., can you please guide me to how to edit the default options of "ckeditor_rails" like normal ckeditor do. Please help me.! Thanks in Advance.


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/d23e3f92-c57c-4a7f-883b-e4f6fdd36ebb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails




2014-08-31 19:16 GMT+02:00 Thomas O'Boyle <thomashoboyle@gmail.com>:
 I added the "has_many: cars" line in app/models/user.rb just like the instructor.  

Typo or copied? It has to be `has_many :cars` instead of `has_many: cars`! 

If it is just a typo, please show us your complete `db/schema.rb` and `app/models/{user,car}.rb`

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BbCVss__SivyCT8DjcZynUXsS90wCyCWgjEKjJQ6neFHcjERA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I am trying to learn Ruby on Rails, so this may be a pretty basic
question.

I have added new columns to an existing table using
'rails generate migration add_column_to_table' command.

I don't see any change in model & view due to this.

So, I changed the all the views (like _form.html.erb & index.html.erb)
to include a new form element like:
<%= f.label :filename %><br>
<%= f.text_field :filename %>

where :filename was the new column.

When I run the rails, while the new column comes on UI, it doesn't get
saved into db. I think the binding between View and Model is missing.

Is there a way to add a new column in the table to all layers
(view/controller/model etc) apart from the db.

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/080c37def7708ef100f8e76a87b9abc1%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hassan Schroeder wrote in post #1156440:
> On Sat, Aug 30, 2014 at 4:00 PM, David Williams <lists@ruby-forum.com>
> wrote:
>> I'm having trouble completing a large project, because I'm missing a
>> feature that is necessary to finish building it. Does anyone know of a
>> website builder gem that has drag-drop, view projectors like Wix
>
> I for one have no idea what "view projectors" means, or what "Wix"
> is or does.
>
> Perhaps you could describe your actual goal a little more precisely?
>
> --
> Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
> http://about.me/hassanschroeder
> twitter: @hassan

I apologize for not explaining clearly enough. I'm trying to build a
feature that gives users the ability to create web pages (predefined
drag and drop items included), and then I would like to present those
web pages on my domain with the link of that person's name.
www.example.com/jennycraig. I can't seem to find the gem for this
feature, but it has existed for at least 4 years now.

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7f1240567d0564a4259621b9b780d008%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Thanks for replying Colin.  I added the "has_many: cars" line in app/models/user.rb just like the instructor.  With the attr_accessible part, everything is exactly as it is in the tutorial.  I have gone through the project serval times to insure that I am doing everything right and get the same issues every time.

Thanks again for replying! 

On Sunday, August 31, 2014 10:00:16 AM UTC-7, Colin Law wrote:
On 31 August 2014 17:29, Thomas O'Boyle <thomas...@gmail.com> wrote:
> Hi Nobert,
>
> Thanks for responding to my question.  I have completely followed his steps
> until the restart part.  I did notice that when the instructor adds
> attributes such as :condition and :year that they automatically appear in
> sublime, but when I check my work in atom the attr_accessible does not
> appear.  Could this be the issue?

You did not answer the question as to whether you have added the line
has_many :cars in app/models/user.rb?
As to the issue with attr_accessible, you have to make sure that your
code is the same as the one in the tutorial.

Colin


>
> Thanks again for responding!
>
> On Sunday, August 31, 2014 1:26:24 AM UTC-7, Norbert Melzer wrote:
>>
>> Have you followed his steps and changed your model? In other words, have
>> you added the line has_many :cars in app/models/user.rb?
>>
>> Am 31.08.2014 09:42 schrieb "Thomas O'Boyle" <thomas...@gmail.com>:
>>>
>>> Hi All,
>>>
>>> I just started the UT on Rails class through reddit and am completely new
>>> to programing.  I apologize for not being able to articulate my problem
>>> clearly.  I am watching this video
>>> https://www.youtube.com/watch?v=EU98yHB-_7A and at 16:18 when the instructor
>>> restarts something (terminal) I get completely lost.  He consules back into
>>> rails after this restart but when I do this I get this:
>>>
>>> "User.last.cars
>>>
>>>   User Load (0.4ms)  SELECT  "users".* FROM "users"   ORDER BY
>>> "users"."id" DESC LIMIT 1
>>>
>>> NoMethodError: undefined method `cars' for #<User:0x00......."
>>>
>>>
>>> I apologize again for the poorly asked question but I am really new with
>>> all of this.
>>>
>>> Thanks so much!
>>>
>>>
>>> Happy labor day!
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Ruby on Rails: Talk" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to rubyonrails-ta...@googlegroups.com.
>>> To post to this group, send email to rubyonra...@googlegroups.com.
>>>
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/rubyonrails-talk/4e8763a7-5235-400e-af07-209a44a5c30b%40googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/94d15c75-9b8d-4b75-90d7-5d7671f52217%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/824b8158-af90-491b-b49e-ea416924f516%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On 31 August 2014 17:29, Thomas O'Boyle <thomashoboyle@gmail.com> wrote:
> Hi Nobert,
>
> Thanks for responding to my question. I have completely followed his steps
> until the restart part. I did notice that when the instructor adds
> attributes such as :condition and :year that they automatically appear in
> sublime, but when I check my work in atom the attr_accessible does not
> appear. Could this be the issue?

You did not answer the question as to whether you have added the line
has_many :cars in app/models/user.rb?
As to the issue with attr_accessible, you have to make sure that your
code is the same as the one in the tutorial.

Colin


>
> Thanks again for responding!
>
> On Sunday, August 31, 2014 1:26:24 AM UTC-7, Norbert Melzer wrote:
>>
>> Have you followed his steps and changed your model? In other words, have
>> you added the line has_many :cars in app/models/user.rb?
>>
>> Am 31.08.2014 09:42 schrieb "Thomas O'Boyle" <thomas...@gmail.com>:
>>>
>>> Hi All,
>>>
>>> I just started the UT on Rails class through reddit and am completely new
>>> to programing. I apologize for not being able to articulate my problem
>>> clearly. I am watching this video
>>> https://www.youtube.com/watch?v=EU98yHB-_7A and at 16:18 when the instructor
>>> restarts something (terminal) I get completely lost. He consules back into
>>> rails after this restart but when I do this I get this:
>>>
>>> "User.last.cars
>>>
>>> User Load (0.4ms) SELECT "users".* FROM "users" ORDER BY
>>> "users"."id" DESC LIMIT 1
>>>
>>> NoMethodError: undefined method `cars' for #<User:0x00......."
>>>
>>>
>>> I apologize again for the poorly asked question but I am really new with
>>> all of this.
>>>
>>> Thanks so much!
>>>
>>>
>>> Happy labor day!
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Ruby on Rails: Talk" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to rubyonrails-ta...@googlegroups.com.
>>> To post to this group, send email to rubyonra...@googlegroups.com.
>>>
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/rubyonrails-talk/4e8763a7-5235-400e-af07-209a44a5c30b%40googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/94d15c75-9b8d-4b75-90d7-5d7671f52217%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtRBLzsz-bXvgSH-GNnE00Z5KBHf7WTizWObJtP9vE23Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hi Nobert,

Thanks for responding to my question.  I have completely followed his steps until the restart part.  I did notice that when the instructor adds attributes such as :condition and :year that they automatically appear in sublime, but when I check my work in atom the attr_accessible does not appear.  Could this be the issue?

Thanks again for responding!

On Sunday, August 31, 2014 1:26:24 AM UTC-7, Norbert Melzer wrote:

Have you followed his steps and changed your model? In other words, have you added the line has_many :cars in app/models/user.rb?

Am 31.08.2014 09:42 schrieb "Thomas O'Boyle" <thomas...@gmail.com>:
Hi All,

I just started the UT on Rails class through reddit and am completely new to programing.  I apologize for not being able to articulate my problem clearly.  I am watching this video https://www.youtube.com/watch?v=EU98yHB-_7A and at 16:18 when the instructor restarts something (terminal) I get completely lost.  He consules back into rails after this restart but when I do this I get this:

"User.last.cars

  User Load (0.4ms)  SELECT  "users".* FROM "users"   ORDER BY "users"."id" DESC LIMIT 1

NoMethodError: undefined method `cars' for #<User:0x00......."


I apologize again for the poorly asked question but I am really new with all of this.

Thanks so much!


Happy labor day!

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4e8763a7-5235-400e-af07-209a44a5c30b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/94d15c75-9b8d-4b75-90d7-5d7671f52217%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On Sat, Aug 30, 2014 at 4:00 PM, David Williams <lists@ruby-forum.com> wrote:
> I'm having trouble completing a large project, because I'm missing a
> feature that is necessary to finish building it. Does anyone know of a
> website builder gem that has drag-drop, view projectors like Wix

I for one have no idea what "view projectors" means, or what "Wix"
is or does.

Perhaps you could describe your actual goal a little more precisely?

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yDGfntDfMh9%2B%3DJJ%2BPTTgjnNzTwiYJJEpWfd0EcQQaeKRw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

The old logo is pretty cool, but missing logo buttons and other things.

Dne neděle, 31. srpna 2014 3:01:38 UTC+2 Designby Lefty napsal(a):
What do you think guys ????? i think the Shiny Door is (sorry for the modesty) a great finding because soooo true.


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/ede27085-4d89-4d98-84a3-917991f1c725%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

:thumpsup:
nice one indeed, try to add some tests.


On Sunday, August 31, 2014 5:57:44 AM UTC+3, Jason FB wrote:

Announcing nondestructive_migrations : A Gem separating schema-only migrations from nondestrucitve (data) migrations in your Rails app


For more information:
https://github.com/jasonfb/nondestructive_migrations


Enjoy!

Jason


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/f17e4c18-004c-4cc7-a161-66b80fb8ed98%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Have you followed his steps and changed your model? In other words, have you added the line has_many :cars in app/models/user.rb?

Am 31.08.2014 09:42 schrieb "Thomas O'Boyle" <thomashoboyle@gmail.com>:
Hi All,

I just started the UT on Rails class through reddit and am completely new to programing.  I apologize for not being able to articulate my problem clearly.  I am watching this video https://www.youtube.com/watch?v=EU98yHB-_7A and at 16:18 when the instructor restarts something (terminal) I get completely lost.  He consules back into rails after this restart but when I do this I get this:

"User.last.cars

  User Load (0.4ms)  SELECT  "users".* FROM "users"   ORDER BY "users"."id" DESC LIMIT 1

NoMethodError: undefined method `cars' for #<User:0x00......."


I apologize again for the poorly asked question but I am really new with all of this.

Thanks so much!


Happy labor day!

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4e8763a7-5235-400e-af07-209a44a5c30b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CA%2BbCVsu%2B8zxYuG5X74ighSYiZpCq%3DOX7Et5PYRBY9P_bEQ1ZOw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Hi All,

I just started the UT on Rails class through reddit and am completely new to programing.  I apologize for not being able to articulate my problem clearly.  I am watching this video https://www.youtube.com/watch?v=EU98yHB-_7A and at 16:18 when the instructor restarts something (terminal) I get completely lost.  He consules back into rails after this restart but when I do this I get this:

"User.last.cars

  User Load (0.4ms)  SELECT  "users".* FROM "users"   ORDER BY "users"."id" DESC LIMIT 1

NoMethodError: undefined method `cars' for #<User:0x00......."


I apologize again for the poorly asked question but I am really new with all of this.

Thanks so much!


Happy labor day!

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/4e8763a7-5235-400e-af07-209a44a5c30b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails Saturday, August 30, 2014

Visit this link to see and possibly answer my question.

http://stackoverflow.com/questions/25581755/create-and-update-with-nested-models-using-strong-parameters-rails

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/27900de04353b63a8ece67fbf9d91b9e%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

Announcing nondestructive_migrations : A Gem separating schema-only migrations from nondestrucitve (data) migrations in your Rails app


For more information:
https://github.com/jasonfb/nondestructive_migrations


Enjoy!

Jason


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/F1397BDD-EB97-47EC-A05C-9197E4DF7163%40datatravels.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

What do you think guys ????? i think the Shiny Door is (sorry for the modesty) a great finding because soooo true.


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b196247f-4192-4544-bab1-ad411e8556aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I am trying to create my first ever program Using Ruby programming
language on Ruby on Rails and it is a blog! I am following a tutorial
and have created a comments box which does NOT print the comment on the
page so far when written in the comments box, that's the problem. I will
explain step by step I have:

1. Called out on routes.rb:

resources :posts do
resources :comments
end

2. Called out using Cmder:
rails g controller comments create destroy


3. This is my comments_controller.rb class:

class CommentsController < ApplicationController
def create
@post = Post.find(params[:post_id])
@comment = @post.comments.build(params[:comment]) #around here is
the error
@comment.save

redirect_to @post
end

def destroy
end
end



can anybody please help?

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/335bf9a03da77a47707ee83e516d92d4%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

I'm having trouble completing a large project, because I'm missing a
feature that is necessary to finish building it. Does anyone know of a
website builder gem that has drag-drop, view projectors like Wix does
for example? If you don't know of a gem like this one. Is there a method
or approach that I can use to build such a feature with Ruby on Rails?

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/fddfef2e220e53807957ad57793bb59b%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

This certainly sounds reasonable, not rubbish at all.

I think I was begging for trouble when I wanted to test the class
membership, which certainly is not in spirit with ActiveRecord and/or
Duck Typing OOP....

I guess the solution I'm trying is "too dirty", and I just was bitten by
it.

Ronald

--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/bf1967dadc2077efb38fa08be98959ad%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On Sat, Aug 30, 2014 at 9:28 AM, Roelof Wobben <rwobben@hotmail.com> wrote:

> Anyone suggestions how I can make it work with invites or another way ?

There are a ton of resources available for using devise. Besides
the README, I'd recommend spending some time here:

https://github.com/plataformatec/devise/wiki

Good luck,
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yAKNxHSfPAh2vK-akOht0xD063tLzEh9Kk0T-49O4isZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails



Op zaterdag 30 augustus 2014 18:22:14 UTC+2 schreef Hassan Schroeder:
On Sat, Aug 30, 2014 at 8:05 AM, Roelof Wobben <rwo...@hotmail.com> wrote:

>> > > The only thing I need is that I as admin can register user with a
>> > > password.
>> > > If the user looses her/his password then I get a mail and I as admin
>> > > can make a new one.

> Why I need a password for staff members so they can only see which invoice
> is not payed or add a payment.

Requiring staff to authenticate makes sense.

Having *you set the password* for each staff member does not.

For one thing, it doesn't scale. More importantly, how do you plan
to communicate this password to the person? By email? Extremely
insecure. By phone? In person? Not always convenient.

Enabling each staff member to *set/reset their own password* is a
far more efficient (and common) pattern.

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan


Oke, So im on the wrong path. That is why I could not make it work.


Anyone suggestions how I can make it work with invites or another way ? 

Roelof
 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/17657adf-c8af-46de-a497-11ca139f1913%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On Sat, Aug 30, 2014 at 8:05 AM, Roelof Wobben <rwobben@hotmail.com> wrote:

>> > > The only thing I need is that I as admin can register user with a
>> > > password.
>> > > If the user looses her/his password then I get a mail and I as admin
>> > > can make a new one.

> Why I need a password for staff members so they can only see which invoice
> is not payed or add a payment.

Requiring staff to authenticate makes sense.

Having *you set the password* for each staff member does not.

For one thing, it doesn't scale. More importantly, how do you plan
to communicate this password to the person? By email? Extremely
insecure. By phone? In person? Not always convenient.

Enabling each staff member to *set/reset their own password* is a
far more efficient (and common) pattern.

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yA9RZMSiDGDoEbXkmDVVC_OdARC301fEYM25Qqu3p9Ryg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

@Walter:

Maybe your suggestion about invite can work.
Do you have a project where I can look how things are working then ?

Roelof


Op zaterdag 30 augustus 2014 17:05:11 UTC+2 schreef Roelof Wobben:


Op zaterdag 30 augustus 2014 16:52:26 UTC+2 schreef Walter Lee Davis:

On Aug 30, 2014, at 3:22 AM, Roelof Wobben wrote:

>
>
> Op zaterdag 30 augustus 2014 07:18:55 UTC+2 schreef Walter Lee Davis:
>
> On Aug 29, 2014, at 4:24 PM, Roelof Wobben wrote:
>
> > Hello,
> >
> > I want to use Devise for authecation.
> > The only thing I need is that I as admin can register user with a password.
> > If the user looses her/his password then I get a mail and I as admin can make a new one.
> >
> > Which modules can I use the best ?
>
> Take a look at devise_invitable. That lets you invite a new user to your site (and if you close off the registration module, then you can't just sign up yourself). The user gets to set her own password when she accepts the invitation mail, and then use the password reset system if she forgets it later.
>
> Walter
>  
>
>
>
> My app does not invite people,
>
> I trying to make a financial app.
> The problem is that I have customers which are also a staff member.
>
> Staff members need a password which I will provide but customers will and must not log into my app,
>
> Roelof

I'm not aware of any authentication design pattern where the user does not get to set their own password, either through initial registration or through automated reset later. Why do you want to know their password at all, even initially? If the word invitation sets you off, think of it as sending someone their initial account credentials. The first thing they will do is set their own password, and from then on, it's just another account. It doesn't matter if that account is for a customer or a staff person.

I've used invitable in several applications that had multiple user levels (authorization) but that's getting outside of Devise's wheelhouse (authentication). Can you widen the frame a little and explain why you need to set the password for the staff members?



What  I have in mind is a app for a toy library.
So the customers chooses a plan and get yearly a invoice.
but some customers are work for the toy library.

Later on I will try to implement payments by cash or by bank.
Also later on I will try to implement that we know which customer has borrowed which toy and when he/she has to bring it bac

Why I need a password for staff members so they can only see which invoice is not payed or add a payment.
I do not want that customers can see the financial thing of thier own of from another person.
All the data in my 'accounting" system is private for staff members.
 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/2468dc8b-58b0-44b0-9454-bcb8f62f4654%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

It is not trying to fetch anything from another server.

It does not happen every time i perform the request. Only once when i was requesting the page. 


def index

  images = Image.order("id DESC").limit(IMAGES_PER_PAGE+1).offset(offset) 

  if images.length > IMAGES_PER_PAGE

    hasMore = "yes"

    images = images.first(IMAGES_PER_PAGE)

    offset = offset + IMAGES_PER_PAGE

  end

  finaljson = {:type => "index", :offset => offset, :iteration => 0, :limit => IMAGES_PER_PAGE, , :images => images}

  render :status=>200, :json => finaljson.to_json(:include => :comments)

end


On Saturday, August 30, 2014 8:54:58 PM UTC+8, Colin Law wrote:
On 30 August 2014 13:28, ruby user <tyl...@gmail.com> wrote:
> I am getting problems with a json request using the rails api gem and
> webrick.
>
> When i do a index search with GET, i have an error ERROR Errno::ECONNRESET:
> Connection reset by peer @ io_fillbuf. Below is a full log of the problem.I
> have been trying to google the io_fillbuf but i can't seem to find any clear
> answers to what it is.
>
> In my ApplicationController i have "skip_before_action
> :verify_authenticity_token" as I am just using rails api for a pure json
> app.
>
> Started GET "/api/v1/images.json?type=index&more=yes&offset=80" for
> 169.254.249.61 at 2014-08-21 10:30:15 Processing by
> Api::V1::ImagesController#index as JSON
>
> Parameters: {"type"=>"index", "more"=>"yes", "offset"=>"80"} index
>
> params type index
> images length 20
> Completed 200 OK in 97ms (Views: 0.1ms | ActiveRecord: 0.0ms)
> [2014-08-21 10:30:15] ERROR Errno::ECONNRESET: Connection reset by peer @
> io_fillbuf - fd:19

Is it trying to fetch something from another server?  If so perhaps
that connection is failing.
Show us ImagesController#index
Does it happen every time you perform the request?

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/293f0545-aa5c-411a-98b8-87cff5002f0a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails



Op zaterdag 30 augustus 2014 16:52:26 UTC+2 schreef Walter Lee Davis:

On Aug 30, 2014, at 3:22 AM, Roelof Wobben wrote:

>
>
> Op zaterdag 30 augustus 2014 07:18:55 UTC+2 schreef Walter Lee Davis:
>
> On Aug 29, 2014, at 4:24 PM, Roelof Wobben wrote:
>
> > Hello,
> >
> > I want to use Devise for authecation.
> > The only thing I need is that I as admin can register user with a password.
> > If the user looses her/his password then I get a mail and I as admin can make a new one.
> >
> > Which modules can I use the best ?
>
> Take a look at devise_invitable. That lets you invite a new user to your site (and if you close off the registration module, then you can't just sign up yourself). The user gets to set her own password when she accepts the invitation mail, and then use the password reset system if she forgets it later.
>
> Walter
>  
>
>
>
> My app does not invite people,
>
> I trying to make a financial app.
> The problem is that I have customers which are also a staff member.
>
> Staff members need a password which I will provide but customers will and must not log into my app,
>
> Roelof

I'm not aware of any authentication design pattern where the user does not get to set their own password, either through initial registration or through automated reset later. Why do you want to know their password at all, even initially? If the word invitation sets you off, think of it as sending someone their initial account credentials. The first thing they will do is set their own password, and from then on, it's just another account. It doesn't matter if that account is for a customer or a staff person.

I've used invitable in several applications that had multiple user levels (authorization) but that's getting outside of Devise's wheelhouse (authentication). Can you widen the frame a little and explain why you need to set the password for the staff members?



What  I have in mind is a app for a toy library.
So the customers chooses a plan and get yearly a invoice.
but some customers are work for the toy library.

Later on I will try to implement payments by cash or by bank.
Also later on I will try to implement that we know which customer has borrowed which toy and when he/she has to bring it bac

Why I need a password for staff members so they can only see which invoice is not payed or add a payment.
I do not want that customers can see the financial thing of thier own of from another person.
All the data in my 'accounting" system is private for staff members.
 

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b2353e31-d074-4838-aae4-feecd4aa2d73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On 30 August 2014 14:20, Ronald Fischer <lists@ruby-forum.com> wrote:
> Rails 4, Ruby 2
>
> Model has Card and Idiom
> and Idiom belongs_to :card
>
> In my Rails console I have an Idiom i and get the card from it:
>
> c=i.card
>
> => #<Card id: 19, ....>
>
> Now I do:
>
> c.is_a?(Card)
> => false
>
> c.instance_of?(Card)
> => false
>
> Ooops! Why false in both cases?
>
> c.class.name
> => "Card"
> c.class.name==Card.name
> => true
>
> The class name is the same, but the class isn't? Please explain....
>
> And now an explanation why I want to do it:
>
> I have a function which is "overloaded", in that it's single argument
> can be either of a certain clas (in my case, Card (or a subclass of
> it)), or a Fixnum, and I need to distinguish between these cases.
>
> I know that it is not the best style of querying the type of a variable
> at runtime, but the only alternatives I could think of, would be to
> either provide two differently named functions, or have an hash argument
> with two types of keywords, and I don't like both of these solutions.
> Aside from this, I'm really curious to know why is_a? doesn't work
> here.

I *think* it is because it is actually an ActiveRecord Association,
which is converted for you into a Card when you use it (and this may
involve querying the database for example). So in the console it sees
you need to display c.card so it fetches it from the database (if it
has not already been fetched) and displays it as a Card. Apparently
(and I am postulating here) when you do c.class it becomes a card in
order to call the method class on it, but when you pass it to is_a? it
does not (since it does not know until inside is_a? whether it needs
to evaluate it). I may be talking rubbish here in which case someone
more knowledgeable about the internal workings of Rails will jump in.

Colin

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLu2_3thgHYtOHQDCtP6YQc_fjvo_v%3D-xubL204foqqLXw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ruby on Rails

On Aug 30, 2014, at 3:22 AM, Roelof Wobben wrote:

>
>
> Op zaterdag 30 augustus 2014 07:18:55 UTC+2 schreef Walter Lee Davis:
>
> On Aug 29, 2014, at 4:24 PM, Roelof Wobben wrote:
>
> > Hello,
> >
> > I want to use Devise for authecation.
> > The only thing I need is that I as admin can register user with a password.
> > If the user looses her/his password then I get a mail and I as admin can make a new one.
> >
> > Which modules can I use the best ?
>
> Take a look at devise_invitable. That lets you invite a new user to your site (and if you close off the registration module, then you can't just sign up yourself). The user gets to set her own password when she accepts the invitation mail, and then use the password reset system if she forgets it later.
>
> Walter
>
>
>
>
> My app does not invite people,
>
> I trying to make a financial app.
> The problem is that I have customers which are also a staff member.
>
> Staff members need a password which I will provide but customers will and must not log into my app,
>
> Roelof

I'm not aware of any authentication design pattern where the user does not get to set their own password, either through initial registration or through automated reset later. Why do you want to know their password at all, even initially? If the word invitation sets you off, think of it as sending someone their initial account credentials. The first thing they will do is set their own password, and from then on, it's just another account. It doesn't matter if that account is for a customer or a staff person.

I've used invitable in several applications that had multiple user levels (authorization) but that's getting outside of Devise's wheelhouse (authentication). Can you widen the frame a little and explain why you need to set the password for the staff members?

Walter

>
>
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/6ca45e52-51f7-4d29-8957-e9cd9d278787%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/D9C294C0-5572-4E2E-9D78-CC41FEA7788C%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.